mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 06:53:52 +01:00
check for existence of active_thread
This commit is contained in:
parent
1c67af2ddd
commit
85bd8cae17
@ -29,7 +29,7 @@
|
||||
#include "cpu-conf.h"
|
||||
#define DEBUG_PRINT(...) \
|
||||
do { \
|
||||
if (active_thread->stack_size > KERNEL_CONF_STACKSIZE_PRINTF) { \
|
||||
if ((active_thread == NULL) || (active_thread->stack_size > KERNEL_CONF_STACKSIZE_PRINTF)) { \
|
||||
printf(__VA_ARGS__); \
|
||||
} \
|
||||
else { \
|
||||
@ -46,7 +46,8 @@
|
||||
#define DEBUGF(...) \
|
||||
do { \
|
||||
DEBUG_PRINT("DEBUG(%s): %s:%d in %s: ", \
|
||||
active_thread->name, __FILE__, __LINE__, __func__); \
|
||||
active_thread ? active_thread->name : "NO THREAD", \
|
||||
__FILE__, __LINE__, __func__); \
|
||||
DEBUG_PRINT(__VA_ARGS__); \
|
||||
} while (0)
|
||||
#undef ENABLE_DEBUG
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user