sta-core/include/sta/debugging.hpp
2023-07-12 13:33:34 +02:00

41 lines
817 B
C++

#ifndef STA_CORE_DEBUGGING_HPP
#define STA_CORE_DEBUGGING_HPP
#include <sta/config.hpp>
#ifdef STA_DEBUGGING_ENABLED
#include <sta/printable.hpp>
namespace sta
{
extern Printable * Debug;
} // namespace sta
/**
* @brief Debug print message.
*
* @param ... See @ref sta::PrintableUART::print
*
* @ingroup sta_core_debug
*/
# define STA_DEBUG_PRINT(...) sta::Debug->print(__VA_ARGS__)
/**
* @brief Debug print message followed by new-line to UART.
*
* @param ... See @ref sta::PrintableUART::println
*
* @ingroup sta_core_debug
*/
# define STA_DEBUG_PRINTLN(...) sta::Debug->println(__VA_ARGS__)
#else // !STA_DEBUGGING_ENABLED
# define STA_DEBUG_PRINT(...) ((void)0)
# define STA_DEBUG_PRINTLN(...) ((void)0)
#endif // STA_DEBUGGING_ENABLED
#endif // STA_CORE_DEBUGGING_HPP