Skip to content
Snippets Groups Projects
Commit 85bd8cae authored by Oleg Hahm's avatar Oleg Hahm
Browse files

check for existence of active_thread

parent 1c67af2d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment