提交 b9ec9d64 编写于 作者: X xieyangrun

finsh init change to application thread

上级 01c43e8b
...@@ -83,6 +83,13 @@ void rt_init_thread_entry(void* parameter) ...@@ -83,6 +83,13 @@ void rt_init_thread_entry(void* parameter)
rt_device_t dev; rt_device_t dev;
rt_kprintf("SYSTEM running at %uhz\n", SystemCoreClock); rt_kprintf("SYSTEM running at %uhz\n", SystemCoreClock);
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
finsh_set_device("uart1");
#endif
LED_Init(); LED_Init();
configure_extint_channel(); configure_extint_channel();
configure_extint_callbacks(); configure_extint_callbacks();
...@@ -90,7 +97,7 @@ void rt_init_thread_entry(void* parameter) ...@@ -90,7 +97,7 @@ void rt_init_thread_entry(void* parameter)
#ifndef TEST_UART_RX #ifndef TEST_UART_RX
sleep_timer_init(); sleep_timer_init();
// sleep_timer_start(1500); // sleep_timer_start(1500);
while (1) while (1)
{ {
......
...@@ -49,11 +49,11 @@ extern int __bss_end; ...@@ -49,11 +49,11 @@ extern int __bss_end;
*******************************************************************************/ *******************************************************************************/
void assert_failed(uint8_t* file, uint32_t line) void assert_failed(uint8_t* file, uint32_t line)
{ {
rt_kprintf("\n\r Wrong parameter value detected on\r\n"); rt_kprintf("\n\r Wrong parameter value detected on\r\n");
rt_kprintf(" file %s\r\n", file); rt_kprintf(" file %s\r\n", file);
rt_kprintf(" line %d\r\n", line); rt_kprintf(" line %d\r\n", line);
while (1) ; while (1) ;
} }
#endif #endif
...@@ -62,66 +62,60 @@ void assert_failed(uint8_t* file, uint32_t line) ...@@ -62,66 +62,60 @@ void assert_failed(uint8_t* file, uint32_t line)
*/ */
void rtthread_startup(void) void rtthread_startup(void)
{ {
/* init board */ /* init board */
rt_board_init(); rt_board_init();
/* show version */ /* show version */
rt_show_version(); rt_show_version();
/* init tick */ /* init tick */
rt_system_tick_init(); rt_system_tick_init();
/* init kernel object */ /* init kernel object */
rt_system_object_init(); rt_system_object_init();
/* init timer system */ /* init timer system */
rt_system_timer_init(); rt_system_timer_init();
#ifdef RT_USING_HEAP #ifdef RT_USING_HEAP
#ifdef __CC_ARM #ifdef __CC_ARM
rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)CHIP_SRAM_END); rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)CHIP_SRAM_END);
#elif __ICCARM__ #elif __ICCARM__
rt_system_heap_init(__segment_end("HEAP"), (void*)CHIP_SRAM_END); rt_system_heap_init(__segment_end("HEAP"), (void*)CHIP_SRAM_END);
#else #else
/* init memory system */ /* init memory system */
rt_system_heap_init((void*)&__bss_end, (void*)CHIP_SRAM_END); rt_system_heap_init((void*)&__bss_end, (void*)CHIP_SRAM_END);
#endif #endif
#endif #endif
/* init scheduler system */ /* init scheduler system */
rt_system_scheduler_init(); rt_system_scheduler_init();
/* init application */ /* init application */
rt_application_init(); rt_application_init();
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
finsh_set_device("uart1");
#endif
/* init timer thread */ /* init timer thread */
rt_system_timer_thread_init(); rt_system_timer_thread_init();
/* init idle thread */ /* init idle thread */
rt_thread_idle_init(); rt_thread_idle_init();
/* start scheduler */ /* start scheduler */
rt_system_scheduler_start(); rt_system_scheduler_start();
/* never reach here */ /* never reach here */
return ; return ;
} }
int main(void) int main(void)
{ {
/* disable interrupt first */ /* disable interrupt first */
rt_hw_interrupt_disable(); rt_hw_interrupt_disable();
/* startup RT-Thread RTOS */ /* startup RT-Thread RTOS */
rtthread_startup(); rtthread_startup();
return 0; return 0;
} }
/*@}*/ /*@}*/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册