From 0d7ba79219f939ad0dc55eb70872e11c950b0da8 Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 6 Mar 2019 17:07:15 +0800 Subject: Remove the DBG_COLOR and DBG_ENABLE definition. --- include/rtdbg.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/rtdbg.h b/include/rtdbg.h index 9036a0cd66..97845321e7 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -19,16 +19,12 @@ * header file. * * #define DBG_SECTION_NAME "MOD" - * #define DBG_ENABLE // enable debug macro * #define DBG_LEVEL DBG_INFO - * #include // must after of DEBUG_ENABLE or some other options + * #include // must after of DBG_LEVEL, DBG_SECTION_NAME or other options * * Then in your C/C++ file, you can use LOG_X macro to print out logs: * LOG_D("this is a debug log!"); * LOG_E("this is a error log!"); - * - * If you want to use different color for different kinds log, you can - * #define DBG_COLOR */ #ifndef RT_DBG_H__ @@ -36,6 +32,16 @@ #include +/* the debug log will force enable when RT_DEBUG macro is defined */ +#if defined(RT_DEBUG) && !defined(DBG_ENABLE) +#define DBG_ENABLE +#endif + +/* it will force output color log when RT_DEBUG_COLOR macro is defined */ +#if defined(RT_DEBUG_COLOR) && !defined(DBG_COLOR) +#define DBG_COLOR +#endif + #if defined(RT_USING_ULOG) && defined(DBG_ENABLE) /* using ulog compatible with rtdbg */ #include -- cgit v1.3.1 From 8fa6c1d9cd4935d0df8432355e6285231000462b Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 6 Mar 2019 18:02:29 +0800 Subject: Remove dbg_enter and dbg_exit macro. --- include/rtdbg.h | 17 ----------------- src/signal.c | 2 -- 2 files changed, 19 deletions(-) (limited to 'include') diff --git a/include/rtdbg.h b/include/rtdbg.h index 97845321e7..6eb8ceb221 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -114,23 +114,6 @@ __FUNCTION__, __LINE__); \ } -#define dbg_enter \ - if ((DBG_LEVEL) <= DBG_LOG){ \ - _DBG_COLOR(32); \ - rt_kprintf(DBG_SECTION_NAME " Enter %s\n", \ - __FUNCTION__); \ - _DBG_COLOR(0); \ - } - -#define dbg_exit \ - if ((DBG_LEVEL) <= DBG_LOG){ \ - _DBG_COLOR(32); \ - rt_kprintf(DBG_SECTION_NAME " Exit %s:%d\n", \ - __FUNCTION__); \ - _DBG_COLOR(0); \ - } - - #define dbg_log_line(lvl, color_n, fmt, ...) \ do \ { \ diff --git a/src/signal.c b/src/signal.c index c9d6c20805..2d68562535 100644 --- a/src/signal.c +++ b/src/signal.c @@ -49,8 +49,6 @@ static void _signal_entry(void *parameter) { rt_thread_t tid = rt_thread_self(); - dbg_enter; - /* handle signal */ rt_thread_handle_sig(RT_FALSE); -- cgit v1.3.1