* This function will startup RT-Thread RTOS. */
| 43 | * This function will startup RT-Thread RTOS. |
| 44 | */ |
| 45 | void rtthread_startup(void) |
| 46 | { |
| 47 | /* enable cpu cache */ |
| 48 | rt_hw_cpu_icache_enable(); |
| 49 | |
| 50 | /* init hardware interrupt */ |
| 51 | rt_hw_interrupt_init(); |
| 52 | |
| 53 | /* init board */ |
| 54 | rt_hw_board_init(); |
| 55 | |
| 56 | /* init hardware serial */ |
| 57 | rt_serial_init(); |
| 58 | |
| 59 | rt_show_version(); |
| 60 | |
| 61 | /* init timer system */ |
| 62 | rt_system_timer_init(); |
| 63 | |
| 64 | /* init memory system */ |
| 65 | #ifdef RT_USING_HEAP |
| 66 | #ifdef __CC_ARM |
| 67 | rt_system_heap_init((void*)&Image$$RW_RAM1$$ZI$$Limit, (void*)0xD000000); |
| 68 | #else |
| 69 | rt_system_heap_init((void*)&__bss_end, (void*)0xD000000); |
| 70 | #endif |
| 71 | #endif |
| 72 | |
| 73 | /* init scheduler system */ |
| 74 | rt_system_scheduler_init(); |
| 75 | |
| 76 | #ifdef RT_USING_HOOK |
| 77 | /* set idle thread hook */ |
| 78 | rt_thread_idle_sethook(rt_hw_led_flash); |
| 79 | #endif |
| 80 | |
| 81 | /* init application */ |
| 82 | rt_application_init(); |
| 83 | |
| 84 | #ifdef RT_USING_FINSH |
| 85 | /* init the finsh input */ |
| 86 | rt_hw_finsh_init(); |
| 87 | |
| 88 | /* init finsh */ |
| 89 | finsh_system_init(); |
| 90 | #endif |
| 91 | |
| 92 | /* init idle thread */ |
| 93 | rt_thread_idle_init(); |
| 94 | |
| 95 | /* unmask interrupt */ |
| 96 | rt_hw_interrupt_umask(INT_GLOBAL); |
| 97 | |
| 98 | /* start scheduler */ |
| 99 | rt_system_scheduler_start(); |
| 100 | |
| 101 | /* never reach here */ |
| 102 | return ; |
no test coverage detected