Updated printable to reduce mutex operations when printing newlines

This commit is contained in:
dario
2024-06-26 11:29:23 +02:00
committed by dario
parent bcdec5de60
commit 1e41189480
7 changed files with 126 additions and 72 deletions

View File

@@ -19,7 +19,7 @@ namespace sta
*
* @ingroup sta_core_debug
*/
# define STA_DEBUG_PRINT(...) sta::Debug->print(__VA_ARGS__)
# define STA_DEBUG_PRINT(...) sta::Debug->print(__VA_ARGS__)
/**
* @brief Debug print message followed by new-line to UART.
@@ -28,7 +28,7 @@ namespace sta
*
* @ingroup sta_core_debug
*/
# define STA_DEBUG_PRINTLN(...) sta::Debug->println(__VA_ARGS__)
# define STA_DEBUG_PRINTLN(...) sta::Debug->println(__VA_ARGS__)
/**
* @brief Formatted debug printing with new-line.
@@ -36,13 +36,16 @@ namespace sta
* @param fmt See @ref sta::PrintableUART::printf
* @param ... See @ref sta::PrintableUART::printf
*/
# define STA_DEBUG_PRINTF(fmt, ...) sta::Debug->printf(fmt, __VA_ARGS__)
# define STA_DEBUG_PRINTF(fmt, ...) sta::Debug->printf(fmt, __VA_ARGS__)
# define STA_DEBUG_READ(buffer, length) sta::Debug->read(buffer, length)
#else // !STA_DEBUGGING_ENABLED
# define STA_DEBUG_PRINT(...) ((void)0)
# define STA_DEBUG_PRINTLN(...) ((void)0)
# define STA_DEBUG_PRINTF(fmt, ...) ((void)0)
# define STA_DEBUG_PRINT(...) ((void)0)
# define STA_DEBUG_PRINTLN(...) ((void)0)
# define STA_DEBUG_PRINTF(fmt, ...) ((void)0)
# define STA_DEBUG_READ(buffer, length) ((void)0)
#endif // STA_DEBUGGING_ENABLED