diff options
Diffstat (limited to 'src/components.c')
| -rw-r--r-- | src/components.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/components.c b/src/components.c index d77ef8300f..e7824b65ef 100644 --- a/src/components.c +++ b/src/components.c @@ -92,7 +92,7 @@ void rt_components_board_init(void) rt_kprintf(":%d done\n", result); } #else - const init_fn_t *fn_ptr; + volatile const init_fn_t *fn_ptr; for (fn_ptr = &__rt_init_rti_board_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++) { @@ -118,7 +118,7 @@ void rt_components_init(void) rt_kprintf(":%d done\n", result); } #else - const init_fn_t *fn_ptr; + volatile const init_fn_t *fn_ptr; for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++) { @@ -126,6 +126,7 @@ void rt_components_init(void) } #endif } +#endif /* RT_USING_COMPONENTS_INIT */ #ifdef RT_USING_USER_MAIN @@ -138,7 +139,6 @@ extern int $Super$$main(void); /* re-define main function */ int $Sub$$main(void) { - rt_hw_interrupt_disable(); rtthread_startup(); return 0; } @@ -150,16 +150,13 @@ int __low_level_init(void) { // call IAR table copy function. __iar_data_init3(); - rt_hw_interrupt_disable(); rtthread_startup(); return 0; } #elif defined(__GNUC__) -extern int main(void); /* Add -eentry to arm-none-eabi-gcc argument */ int entry(void) { - rt_hw_interrupt_disable(); rtthread_startup(); return 0; } @@ -178,9 +175,10 @@ void main_thread_entry(void *parameter) extern int main(void); extern int $Super$$main(void); +#ifdef RT_USING_COMPONENTS_INIT /* RT-Thread components initialization */ rt_components_init(); - +#endif #ifdef RT_USING_SMP rt_hw_secondary_cpu_up(); #endif @@ -207,7 +205,7 @@ void rt_application_init(void) result = rt_thread_init(tid, "main", main_thread_entry, RT_NULL, main_stack, sizeof(main_stack), RT_MAIN_THREAD_PRIORITY, 20); RT_ASSERT(result == RT_EOK); - + /* if not define RT_USING_HEAP, using to eliminate the warning */ (void)result; #endif @@ -258,4 +256,3 @@ int rtthread_startup(void) return 0; } #endif -#endif |
