* This function will startup RT-Thread RTOS. */
| 42 | * This function will startup RT-Thread RTOS. |
| 43 | */ |
| 44 | void rtthread_startup(void) |
| 45 | { |
| 46 | /* init hardware interrupt */ |
| 47 | rt_hw_interrupt_init(); |
| 48 | |
| 49 | /* init board */ |
| 50 | rt_hw_board_init(); |
| 51 | |
| 52 | rt_show_version(); |
| 53 | |
| 54 | /* init timer system */ |
| 55 | rt_system_timer_init(); |
| 56 | |
| 57 | #ifdef RT_USING_HEAP |
| 58 | #ifdef __CC_ARM |
| 59 | rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x204000); |
| 60 | #elif __ICCARM__ |
| 61 | rt_system_heap_init(__segment_end("HEAP"), (void*)0x204000); |
| 62 | #else |
| 63 | rt_system_heap_init((void*)&__bss_end, (void*)(&__bss_end+0x4000)); |
| 64 | |
| 65 | #endif |
| 66 | #endif |
| 67 | |
| 68 | /* init scheduler system */ |
| 69 | rt_system_scheduler_init(); |
| 70 | |
| 71 | #ifdef RT_USING_HOOK /* if the hook is used */ |
| 72 | /* set idle thread hook */ |
| 73 | rt_thread_idle_sethook(rt_hw_led_flash); |
| 74 | #endif |
| 75 | |
| 76 | #ifdef RT_USING_DEVICE |
| 77 | /* init hardware serial device */ |
| 78 | rt_hw_serial_init(); |
| 79 | #endif |
| 80 | |
| 81 | /* init application */ |
| 82 | rt_application_init(); |
| 83 | |
| 84 | #ifdef RT_USING_FINSH |
| 85 | /* init finsh */ |
| 86 | finsh_system_init(); |
| 87 | #if !defined(RT_USING_POSIX_STDIO) && defined(RT_USING_DEVICE) |
| 88 | finsh_set_device("uart1"); |
| 89 | #endif |
| 90 | #endif |
| 91 | |
| 92 | /* init idle thread */ |
| 93 | rt_thread_idle_init(); |
| 94 | |
| 95 | /* start scheduler */ |
| 96 | rt_system_scheduler_start(); |
| 97 | |
| 98 | /* never reach here */ |
| 99 | return ; |
| 100 | } |
| 101 |
no test coverage detected