mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-09-28 21:17:33 +00:00
Remove debug serial logic from stm32/uart module
This commit is contained in:
30
src/debug_serial.cpp
Normal file
30
src/debug_serial.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <sta/debug_serial.hpp>
|
||||
#ifdef STA_DEBUG_SERIAL_ENABLED
|
||||
|
||||
|
||||
#ifdef STA_PLATFORM_STM32
|
||||
|
||||
#include <sta/stm32/uart.hpp>
|
||||
|
||||
#include <usart.h>
|
||||
|
||||
// Set platform UART alias
|
||||
using PlatformUART = sta::STM32UART;
|
||||
|
||||
#endif // STA_PLATFORM_STM32
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
// Create platform specific serial interface
|
||||
PlatformUART platformDebugSerial(&STA_DEBUG_SERIAL_UART);
|
||||
}
|
||||
|
||||
namespace sta
|
||||
{
|
||||
// Create debug serial object using platform specific serial interface
|
||||
PrintableUART DebugSerial(&platformDebugSerial);
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_DEBUG_SERIAL_ENABLED
|
@@ -22,22 +22,4 @@ namespace sta
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#ifdef STA_STM32_UART_DEBUG_SERIAL
|
||||
|
||||
// Get extern declaration for DebugSerial because const namespace level variables have internal linkage by default
|
||||
#include <sta/debug_serial.hpp>
|
||||
|
||||
#include <usart.h>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
STM32UART gStm32DebugSerial(&STA_STM32_UART_DEBUG_SERIAL);
|
||||
|
||||
// Used by <sta/debug.hpp>
|
||||
PrintableUART DebugSerial(&gStm32DebugSerial);
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_STM32_UART_DEBUG_SERIAL
|
||||
|
||||
|
||||
#endif // STA_STM32_UART_ENABLED
|
||||
|
Reference in New Issue
Block a user