Separate print methods from UART interface

This commit is contained in:
Henrik Stickann
2022-05-07 16:16:19 +02:00
parent e3be99514c
commit bc35c44cb1
7 changed files with 430 additions and 350 deletions

View File

@@ -30,22 +30,20 @@
#ifdef STA_DEBUG_SERIAL_ENABLE
#include <sta/intf/uart.hpp>
#include <sta/printable_uart.hpp>
namespace sta
{
extern UART * const DebugSerial;
extern PrintableUART DebugSerial;
} // namespace sta
# define STA_DEBUG_PRINT(...) sta::DebugSerial->print(__VA_ARGS__)
# define STA_DEBUG_PRINTLN(...) sta::DebugSerial->println(__VA_ARGS__)
# define STA_DEBUG_WRITE(b, s) sta::DebugSerial->write(b, s)
# define STA_DEBUG_PRINT(...) sta::DebugSerial.print(__VA_ARGS__)
# define STA_DEBUG_PRINTLN(...) sta::DebugSerial.println(__VA_ARGS__)
#else // !STA_DEBUG_SERIAL_ENABLE
# define STA_DEBUG_PRINT(...) ((void)0)
# define STA_DEBUG_PRINTLN(...) ((void)0)
# define STA_DEBUG_WRITE(b, s) ((void)0)
#endif // !STA_DEBUG_SERIAL_ENABLE
#endif // STA_DEBUG_SERIAL_HPP