/** * This function will startup RT-Thread RTOS. */ void rtthread_startup(void) { /* init cache */ rt_hw_cache_init(); /* init hardware interrupt */ rt_hw_interrupt_init(); /* copy vector */ memcpy((void *)A_K0BASE, tlb_refill_exception, 0x20); memcpy((void *)(A_K0BASE + 0x180), general_exception, 0x20); memcpy((void *)(A_K0BASE + 0x200), irq_exception, 0x20); /* init board */ rt_hw_board_init(); rt_show_version(); /* init tick */ rt_system_tick_init(); /* init timer system */ rt_system_timer_init(); #ifdef RT_USING_HEAP rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END); #endif /* init scheduler system */ rt_system_scheduler_init(); #ifdef RT_USING_DEVICE /* init all device */ rt_device_init_all(); #endif /* init application */ rt_application_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device(FINSH_DEVICE_NAME); #endif /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ; }
/** * This function will startup RT-Thread RTOS. */ void rtthread_startup(void) { /* init cache */ rt_hw_cache_init(); /* init hardware interrupt */ rt_hw_interrupt_init(); /* init board */ rt_hw_board_init(); rt_show_version(); /* init tick */ rt_system_tick_init(); /* init timer system */ rt_system_timer_init(); #ifdef RT_USING_HEAP rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END); #endif /* init scheduler system */ rt_system_scheduler_init(); #ifdef RT_USING_DEVICE /* init all device */ rt_device_init_all(); #endif /* init application */ rt_application_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device(FINSH_DEVICE_NAME); #endif /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ; }
void rt_hw_board_init(void) { rt_hw_cache_init(); /* init hardware interrupt */ rt_hw_interrupt_init(); rt_hw_uart_init(); #ifdef RT_USING_CONSOLE /* set console device */ rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif /* RT_USING_CONSOLE */ #ifdef RT_USING_HEAP /* init memory system */ rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); #endif #ifdef RT_USING_COMPONENTS_INIT rt_components_board_init(); #endif rt_hw_ost_init(); }