Merge pull request #12760 from benpicco/debug-puts

core: debug: introduce DEBUG_PUTS()
This commit is contained in:
Kaspar Schleiser 2019-11-21 22:06:01 +01:00 committed by GitHub
commit 3eae474e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ extern "C" {
printf(__VA_ARGS__); \ printf(__VA_ARGS__); \
} \ } \
else { \ else { \
puts("Cannot debug, stack too small"); \ puts("Cannot debug, stack too small. Consider using DEBUG_PUTS()."); \
} \ } \
} while (0) } while (0)
#else #else
@ -95,6 +95,14 @@ extern "C" {
* @note Another name for ::DEBUG_PRINT * @note Another name for ::DEBUG_PRINT
*/ */
#define DEBUG(...) if (ENABLE_DEBUG) DEBUG_PRINT(__VA_ARGS__) #define DEBUG(...) if (ENABLE_DEBUG) DEBUG_PRINT(__VA_ARGS__)
/**
* @def DEBUG_PUTS
*
* @brief Print debug information to stdout using puts(), so no stack size
* restrictions do apply.
*/
#define DEBUG_PUTS(str) if (ENABLE_DEBUG) puts(str)
/** @} */ /** @} */
/** /**