additional debug macro

This commit is contained in:
Oleg Hahm 2014-03-03 09:37:50 +00:00
parent 2ef9b78ccf
commit 20b5230466

View File

@ -23,9 +23,9 @@
#define __DEBUG_H #define __DEBUG_H
#include <stdio.h> #include <stdio.h>
#include "sched.h"
#if DEVELHELP #if DEVELHELP
#include "sched.h"
#include "cpu-conf.h" #include "cpu-conf.h"
#define DEBUG_PRINT(...) \ #define DEBUG_PRINT(...) \
do { \ do { \
@ -41,10 +41,18 @@
#endif #endif
#if ENABLE_DEBUG #if ENABLE_DEBUG
#include "tcb.h"
#define DEBUG(...) DEBUG_PRINT(__VA_ARGS__) #define DEBUG(...) DEBUG_PRINT(__VA_ARGS__)
#define DEBUGF(...) \
do { \
DEBUG_PRINT("DEBUG(%s): %s:%d in %s: ", \
active_thread->name, __FILE__, __LINE__, __func__); \
DEBUG_PRINT(__VA_ARGS__); \
} while (0)
#undef ENABLE_DEBUG #undef ENABLE_DEBUG
#else #else
#define DEBUG(...) #define DEBUG(...)
#define DEBUGF(...)
#endif #endif
/** @} */ /** @} */