1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

core/debug: printf what asked to print

This commit is contained in:
Karl Fessel 2023-12-12 09:16:23 +01:00
parent bb07bb6613
commit b39fbe23e3

View File

@ -44,17 +44,7 @@ extern "C" {
*/ */
#ifdef DEVELHELP #ifdef DEVELHELP
#include "cpu_conf.h" #include "cpu_conf.h"
#define DEBUG_PRINT(...) \ #define DEBUG_PRINT(...) do { printf(__VA_ARGS__); } while (0)
do { \
if ((thread_get_active() == NULL) || \
(thread_get_active()->stack_size >= \
THREAD_EXTRA_STACKSIZE_PRINTF)) { \
printf(__VA_ARGS__); \
} \
else { \
puts("Cannot debug, stack too small. Consider using DEBUG_PUTS()."); \
} \
} while (0)
#else #else
#define DEBUG_PRINT(...) printf(__VA_ARGS__) #define DEBUG_PRINT(...) printf(__VA_ARGS__)
#endif #endif