From e2c031643c8dec7c9ea1581216e19bf19c8f73f0 Mon Sep 17 00:00:00 2001 From: Shicheng Chu <1468559561@qq.com> Date: Thu, 29 Jun 2023 23:24:25 +0800 Subject: [include][dbg]update: no longer use RT_DEBUG_LOG in rtdebug.h (#7750) --- src/timer.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index 037b97b134..04e4a91b13 100644 --- a/src/timer.c +++ b/src/timer.c @@ -24,6 +24,14 @@ #include #include +#define DBG_TAG "kernel.timer" +#ifdef RT_DEBUG_TIMER +#define DBG_LVL DBG_LOG +#else +#define DBG_LVL DBG_WARNING +#endif /* defined (RT_DEBUG_TIMER) */ +#include + /* hard timer list */ static rt_list_t _timer_list[RT_TIMER_SKIP_LIST_LEVEL]; @@ -195,7 +203,7 @@ rt_inline void _timer_remove(rt_timer_t timer) } } -#if RT_DEBUG_TIMER +#ifdef RT_DEBUG_TIMER /** * @brief The number of timer * @@ -653,7 +661,7 @@ void rt_timer_check(void) rt_list_init(&list); - RT_DEBUG_LOG(RT_DEBUG_TIMER, ("timer check enter\n")); + LOG_D("timer check enter"); current_tick = rt_tick_get(); @@ -688,7 +696,7 @@ void rt_timer_check(void) current_tick = rt_tick_get(); RT_OBJECT_HOOK_CALL(rt_timer_exit_hook, (t)); - RT_DEBUG_LOG(RT_DEBUG_TIMER, ("current tick: %d\n", current_tick)); + LOG_D("current tick: %d", current_tick); /* Check whether the timer object is detached or started again */ if (rt_list_isempty(&list)) @@ -710,7 +718,7 @@ void rt_timer_check(void) /* enable interrupt */ rt_hw_interrupt_enable(level); - RT_DEBUG_LOG(RT_DEBUG_TIMER, ("timer check leave\n")); + LOG_D("timer check leave"); } /** @@ -739,7 +747,7 @@ void rt_soft_timer_check(void) rt_list_init(&list); - RT_DEBUG_LOG(RT_DEBUG_TIMER, ("software timer check enter\n")); + LOG_D("software timer check enter"); /* disable interrupt */ level = rt_hw_interrupt_disable(); @@ -776,7 +784,7 @@ void rt_soft_timer_check(void) t->timeout_func(t->parameter); RT_OBJECT_HOOK_CALL(rt_timer_exit_hook, (t)); - RT_DEBUG_LOG(RT_DEBUG_TIMER, ("current tick: %d\n", current_tick)); + LOG_D("current tick: %d", current_tick); /* disable interrupt */ level = rt_hw_interrupt_disable(); @@ -801,7 +809,7 @@ void rt_soft_timer_check(void) /* enable interrupt */ rt_hw_interrupt_enable(level); - RT_DEBUG_LOG(RT_DEBUG_TIMER, ("software timer check leave\n")); + LOG_D("software timer check leave"); } /** -- cgit v1.3.1