mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-12-17 00:58:02 +00:00
Updated debug printing for raspi + added persistent_open setting for raspi spi
This commit is contained in:
49
include/sta/debug_printf.hpp
Normal file
49
include/sta/debug_printf.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef STA_CORE_DEBUG_PRINTF_HPP
|
||||
#define STA_CORE_DEBUG_PRINTF_HPP
|
||||
|
||||
#include <sta/config.hpp>
|
||||
|
||||
// Determine if module should be enabled
|
||||
// Condition 1: STA_DEBUG_PRINTF is defined
|
||||
// Condition 2:
|
||||
// STA_DEBUG_PRINTF_FORCE is defined
|
||||
// or
|
||||
// DEBUG is defined but not NDEBUG
|
||||
#ifdef STA_DEBUG_PRINTF
|
||||
# ifdef STA_DEBUG_PRINTF_FORCE
|
||||
# define STA_DEBUG_SERIAL_ENABLED
|
||||
# else // !STA_DEBUG_PRINTF_FORCE
|
||||
# if defined(DEBUG) && !defined(NDEBUG)
|
||||
# define STA_DEBUG_PRINTF_ENABLED
|
||||
# endif // DEBUG && !NDEBUG
|
||||
# endif // !STA_DEBUG_PRINTF_FORCE
|
||||
#endif // STA_DEBUG_PRINTF
|
||||
|
||||
#if defined(STA_DEBUG_PRINTF_ENABLED) || defined(DOXYGEN)
|
||||
|
||||
#include <sta/printable.hpp>
|
||||
|
||||
/**
|
||||
* @brief Print debug output.
|
||||
*
|
||||
* @param ... See @ref sta::PrintableUART::print
|
||||
*
|
||||
* @ingroup sta_core_debug
|
||||
*/
|
||||
# define STA_DEBUG_PRINT(...) sta::print(__VA_ARGS__)
|
||||
/**
|
||||
* @brief Print debug output followed by new-line to UART.
|
||||
*
|
||||
* @param ... See @ref sta::PrintableUART::println
|
||||
*
|
||||
* @ingroup sta_core_debug
|
||||
*/
|
||||
# define STA_DEBUG_PRINTLN(...) sta::println(__VA_ARGS__)
|
||||
|
||||
|
||||
#else // !STA_DEBUG_PRINTF_ENABLED
|
||||
# define STA_DEBUG_PRINT(...) ((void)0)
|
||||
# define STA_DEBUG_PRINTLN(...) ((void)0)
|
||||
#endif // !STA_DEBUG_PRINTF_ENABLED
|
||||
|
||||
#endif // STA_CORE_DEBUG_PRINTF_HPP
|
||||
Reference in New Issue
Block a user