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) --- libcpu/sim/win32/startup.c | 8 ++++---- libcpu/ti-dsp/c28x/cpuport.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'libcpu') diff --git a/libcpu/sim/win32/startup.c b/libcpu/sim/win32/startup.c index 18ef2c997d..583b93205b 100644 --- a/libcpu/sim/win32/startup.c +++ b/libcpu/sim/win32/startup.c @@ -81,7 +81,7 @@ struct rt_init_tag { const char *level; init_fn_t fn; -#if RT_DEBUG_INIT +#ifdef RT_DEBUG_INIT const char *fn_name; #endif }; @@ -114,7 +114,7 @@ static int rt_init_objects_sort(void) { table->level = ((struct rt_init_desc *)ptr_begin)->level; table->fn = ((struct rt_init_desc *)ptr_begin)->fn; -#if RT_DEBUG_INIT +#ifdef RT_DEBUG_INIT table->fn_name = ((struct rt_init_desc *)ptr_begin)->fn_name; #endif ptr_begin += sizeof(struct rt_init_desc) / sizeof(unsigned int); @@ -168,7 +168,7 @@ void rt_components_board_init(void) { break; } -#if RT_DEBUG_INIT +#ifdef RT_DEBUG_INIT rt_kprintf("initialize %s", rt_init_table[index_i].fn_name); result = rt_init_table[index_i].fn(); rt_kprintf(":%d done\n", result); @@ -203,7 +203,7 @@ void rt_components_init(void) { break; } -#if RT_DEBUG_INIT +#ifdef RT_DEBUG_INIT rt_kprintf("initialize %s", rt_init_table[index_i].fn_name); result = rt_init_table[index_i].fn(); rt_kprintf(":%d done\n", result); diff --git a/libcpu/ti-dsp/c28x/cpuport.c b/libcpu/ti-dsp/c28x/cpuport.c index 069449c1dc..f282744dac 100644 --- a/libcpu/ti-dsp/c28x/cpuport.c +++ b/libcpu/ti-dsp/c28x/cpuport.c @@ -13,6 +13,14 @@ #include +#define DBG_TAG "kernel.irq" +#ifdef RT_DEBUG_IRQ +#define DBG_LVL DBG_LOG +#else +#define DBG_LVL DBG_WARNING +#endif /* defined (RT_DEBUG_IRQ) */ +#include + extern volatile rt_uint8_t rt_interrupt_nest; /* exception and interrupt handler table */ @@ -174,14 +182,14 @@ void rt_interrupt_enter(void) RT_OBJECT_HOOK_CALL(rt_interrupt_enter_hook,()); rt_hw_interrupt_enable(level); - RT_DEBUG_LOG(RT_DEBUG_IRQ, ("irq has come..., irq current nest:%d\n", - (rt_int32_t)rt_interrupt_nest)); + LOG_D("irq has come..., irq current nest:%d", + (rt_int32_t)rt_interrupt_nest); } void rt_interrupt_leave(void) { - RT_DEBUG_LOG(RT_DEBUG_IRQ, ("irq is going to leave, irq current nest:%d\n", - (rt_int32_t)rt_interrupt_nest)); + LOG_D("irq is going to leave, irq current nest:%d", + (rt_int32_t)rt_interrupt_nest); rt_hw_interrupt_disable(); RT_OBJECT_HOOK_CALL(rt_interrupt_leave_hook,()); -- cgit v1.3.1