mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-28 18:57:33 +00:00
Modified config.hpp + enabled UART + added startUpExtras
This commit is contained in:
@@ -11,6 +11,19 @@
|
||||
// Use the STM32F411 microprocessor.
|
||||
#include <sta/devices/stm32/mcu/STM32F411xE.hpp>
|
||||
|
||||
// Doesn't really do too much right now. Has to be added for successful compilation.
|
||||
#define STA_PRINTF_USE_STDLIB
|
||||
|
||||
// Enable debug serial output and assertions.
|
||||
#define STA_ASSERT_FORCE
|
||||
#define STA_DEBUGGING_ENABLED
|
||||
|
||||
// Activate the timer for microsecond delays.
|
||||
// #define STA_STM32_DELAY_ENABLE
|
||||
// #define STA_STM32_DELAY_US_TIM htim1
|
||||
|
||||
// Settings for the rtos-utils
|
||||
#define STA_RTOS_SYSTEM_EVENTS_ENABLE
|
||||
#define STA_RTOS_SYSTEM_WATCHDOG_ENABLE
|
||||
|
||||
#endif /* INC_STA_CONFIG_HPP_ */
|
||||
|
40
App/Src/startup.cpp
Normal file
40
App/Src/startup.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* printable.cpp
|
||||
*
|
||||
* Created on: Aug 30, 2023
|
||||
* Author: Dario
|
||||
*/
|
||||
|
||||
#include <cmsis_os2.h>
|
||||
|
||||
#include <usart.h>
|
||||
#include <sta/rtos/mutex.hpp>
|
||||
#include <sta/devices/stm32/bus/uart.hpp>
|
||||
#include <sta/debug/printing/printable_uart.hpp>
|
||||
#include <sta/debug/debug.hpp>
|
||||
|
||||
// The UART mutex defined in freertos.c
|
||||
extern osMutexId_t uartMutexHandle;
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
// Here the printable used for debugging is defined.
|
||||
Printable * Debug;
|
||||
|
||||
namespace rtos
|
||||
{
|
||||
// Override the weak implementation of startupExtras provided in rtos2-utils.
|
||||
void startupExtras(void * argument)
|
||||
{
|
||||
// Initialize the mutex for UART communication.
|
||||
RtosMutex * mutex = new RtosMutex(&uartMutexHandle);
|
||||
|
||||
// Initialize the UART interface and printable object.
|
||||
UARTSettings settings = { .mode = UARTMode::RX_TX };
|
||||
STM32UART * intf_ptr = new STM32UART(&huart2, settings, mutex);
|
||||
Debug = new PrintableUART(intf_ptr);
|
||||
}
|
||||
} // namespace rtos
|
||||
} // namespace sta
|
||||
|
Reference in New Issue
Block a user