4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-03-02 10:15:26 +08:00

[bsp][bluetrum] Adding RT_USING_CONSOLE judgment

This commit is contained in:
greedyhao 2021-08-12 17:12:52 +08:00
parent e6afb03d14
commit 4b4ec3e789

View File

@ -30,6 +30,7 @@ static struct rt_mutex mutex_cache = {0};
extern volatile rt_uint8_t rt_interrupt_nest; extern volatile rt_uint8_t rt_interrupt_nest;
extern uint32_t __heap_start, __heap_end; extern uint32_t __heap_start, __heap_end;
#ifdef RT_USING_CONSOLE
void hal_printf(const char *fmt, ...) void hal_printf(const char *fmt, ...)
{ {
rt_device_t console = rt_console_get_device(); rt_device_t console = rt_console_get_device();
@ -65,6 +66,7 @@ void hal_printf(const char *fmt, ...)
#endif #endif
va_end(args); va_end(args);
} }
#endif
RT_SECTION(".irq.timer") RT_SECTION(".irq.timer")
void timer0_isr(int vector, void *param) void timer0_isr(int vector, void *param)
@ -210,8 +212,10 @@ void exception_isr(void)
extern long list_thread(void); extern long list_thread(void);
sys_error_hook(1); sys_error_hook(1);
#ifdef RT_USING_CONSOLE
rt_console_set_device(RT_NULL); rt_console_set_device(RT_NULL);
rt_kprintf(stack_info, rt_thread_self()->sp, rt_thread_self()->name); rt_kprintf(stack_info, rt_thread_self()->sp, rt_thread_self()->name);
#endif
while(1); while(1);
} }