Merge pull request #12760 from benpicco/debug-puts
core: debug: introduce DEBUG_PUTS()
This commit is contained in:
commit
3eae474e74
@ -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)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user