diff --git a/include/sta/assert.hpp b/include/sta/assert.hpp index e40ad0c..11c92e4 100644 --- a/include/sta/assert.hpp +++ b/include/sta/assert.hpp @@ -1,16 +1,16 @@ /** * @brief Assertion handling. * - * Define `STA_ASSERT_ENABLE` in `` to enable. + * Define **STA_ASSERT_ENABLE** in `` to enable module. * - * Defining `DEBUG` will automatically enable the module. - * Defining `NDEBUG` will always force module to be disabled. + * When **DEBUG** is defined the module will be enabled automatically. + * Defining **NDEBUG** or **STA_ASSERT_DISABLE** always overrides enabling the module. * * Both `assert_failed` and `assert_halt` provide weak definitions and * can be overridden by the application. `assert_halt` is only called * via the STA_HALT macro which can also be provided by the application. * - * The default implementation of `assert_failed` uses `STA_DEBUG_PRINT` internally + * The default implementation of `assert_failed` uses **STA_DEBUG_PRINT** internally * and will not generate any output if ` is disabled. */ #ifndef STA_ASSERT_HPP @@ -24,17 +24,16 @@ # endif // !STA_ASSERT_ENABLE #endif // DEBUG -#ifdef NDEBUG +#if defined(NDEBUG) || defined(STA_ASSERT_DISABLE) # ifdef STA_ASSERT_ENABLE # undef STA_ASSERT_ENABLE # endif // STA_ASSERT_ENABLE -#endif // NDEBUG +#endif // NDEBUG || STA_ASSERT_DISABLE #ifdef STA_ASSERT_ENABLE #include -#include namespace sta diff --git a/include/sta/debug_serial.hpp b/include/sta/debug_serial.hpp index 3865b0c..a42e736 100644 --- a/include/sta/debug_serial.hpp +++ b/include/sta/debug_serial.hpp @@ -1,12 +1,12 @@ /** * @brief Debug output via UART. * - * Define `STA_DEBUG_SERIAL_ENABLE` in `` to enable. + * Define **STA_DEBUG_SERIAL_ENABLE** in `` to enable module. * - * Defining `DEBUG` will automatically enable the module. - * Defining `NDEBUG` will always force module to be disabled. + * When **DEBUG** is defined the module will be enabled automatically. + * Defining **NDEBUG** or **STA_DEBUG_SERIAL_DISABLE** always overrides enabling the module. * - * Application must provide the sta::DebugSerial instance. + * The sta::DebugSerial instance must be provided. * NOTE: Include this header before the definition because * the default internal linkage of const namespace variables * will cause undefined reference errors otherwise. @@ -22,11 +22,11 @@ # endif // !STA_DEBUG_SERIAL_ENABLE #endif // DEBUG -#ifdef NDEBUG +#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 +#endif // NDEBUG || STA_DEBUG_SERIAL_DISABLE #ifdef STA_DEBUG_SERIAL_ENABLE diff --git a/include/sta/lang.hpp b/include/sta/lang.hpp index 07ac63c..f390b50 100644 --- a/include/sta/lang.hpp +++ b/include/sta/lang.hpp @@ -1,3 +1,6 @@ +/** + * @brief Helper for useful compiler features. + */ #ifndef STA_LANG_HPP #define STA_LANG_HPP