Add doxygen docs

This commit is contained in:
Henrik Stickann
2022-05-10 15:36:48 +02:00
parent 8efed8802d
commit f4e3a0ae1c
8 changed files with 339 additions and 160 deletions

View File

@@ -1,4 +1,5 @@
/**
* @file
* @brief Debug output via UART.
*
* Configuration:
@@ -15,17 +16,55 @@
#ifndef STA_DEBUG_SERIAL_HPP
#define STA_DEBUG_SERIAL_HPP
/**
* @defgroup staCoreDebug Debug Serial
* @ingroup staCore
* @brief Debug serial output.
*/
#ifdef DOXYGEN
/**
* @def STA_DEBUG_SERIAL_ENABLE
* @brief Enable module.
*
* Automatically defined if DEBUG is defined.
* Automatically disabled if NDEBUG is defined.
*
* @ingroup staCoreBuildConfig
*/
# define STA_DEBUG_SERIAL_ENABLE
/**
* @def STA_DEBUG_SERIAL_DISABLE
* @brief Force disable module.
*
* Overrides STA_DEBUG_SERIAL_ENABLE option.
*
* @ingroup staCoreBuildConfig
*/
# define STA_DEBUG_SERIAL_DISABLE
#endif // DOXYGEN
#include <sta/config.hpp>
// Check only if STA_DEBUG_SERIAL_FORCE is not defined
#ifndef STA_DEBUG_SERIAL_FORCE
// Disable module if NDEBUG is defined or DEBUG is not
# if defined(NDEBUG) || !defined(DEBUG)
# ifdef STA_DEBUG_SERIAL_ENABLE
# undef STA_DEBUG_SERIAL_ENABLE
# endif // STA_DEBUG_SERIAL_ENABLE
# endif // NDEBUG || !DEBUG
#endif // !STA_DEBUG_SERIAL_FORCE
#ifdef DEBUG
# ifndef STA_DEBUG_SERIAL_ENABLE
# define STA_DEBUG_SERIAL_ENABLE
# endif // !STA_DEBUG_SERIAL_ENABLE
#endif // DEBUG
#if defined(NDEBUG) || defined(STA_DEBUG_SERIAL_DISABLE)
# ifdef STA_DEBUG_SERIAL_ENABLE
# undef STA_DEBUG_SERIAL_ENABLE
# endif // STA_DEBUG_SERIAL_ENABLE
#endif // NDEBUG || STA_DEBUG_SERIAL_DISABLE
// Show enabled module in doxygen output
#ifdef DOXYGEN
# define STA_DEBUG_SERIAL_ENABLE
#endif // DOXYGEN
#ifdef STA_DEBUG_SERIAL_ENABLE
@@ -35,15 +74,35 @@
namespace sta
{
/**
* @brief %UART print object for debug serial output.
*
* @ingroup staCoreDebug
*/
extern PrintableUART DebugSerial;
} // namespace sta
/**
* @brief Print debug output to UART.
*
* @param ... See @ref sta::PrintableUART::print
*
* @ingroup staCoreDebug
*/
# define STA_DEBUG_PRINT(...) sta::DebugSerial.print(__VA_ARGS__)
/**
* @brief Print debug output followed by new-line to UART.
*
* @param ... See @ref sta::PrintableUART::println
*
* @ingroup staCoreDebug
*/
# 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)
#endif // !STA_DEBUG_SERIAL_ENABLE
#endif // STA_DEBUG_SERIAL_HPP