void rt_hw_cpu_init(void) { cpu_usage_init(); cpu_thread = rt_thread_create("cpu", cpu_thread_entry, RT_NULL, 384, 27, 5); if(cpu_thread != RT_NULL) rt_thread_startup(cpu_thread); }
/** * This function will initial STM32 board. */ void rt_hw_board_init() { /* NVIC Configuration */ NVIC_Configuration(); /* Configure the SysTick */ SysTick_Configuration(); /* Hardware Initial */ stm32_hw_usart_init(); stm32_hw_pin_init(); rt_hw_spi_init(); stm32_hwtimer_init(); cpu_usage_init(); #ifdef RT_USING_CONSOLE rt_console_set_device(CONSOLE_DEVICE); #endif }
/** * This function will startup RT-Thread RTOS. */ void rtthread_startup(void) { /* init board */ rt_hw_board_init(); /* show version */ rt_show_version(); /* init tick */ rt_system_tick_init(); /* init kernel object */ rt_system_object_init(); /* init timer system */ rt_system_timer_init(); #ifdef RT_USING_HEAP #ifdef __CC_ARM rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)STM32_SRAM_END); #elif __ICCARM__ rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END); #else /* init memory system */ rt_system_heap_init((void*)&__bss_end, (void*)STM32_SRAM_END); #endif #endif /* init scheduler system */ rt_system_scheduler_init(); /* initialize timer */ rt_system_timer_init(); /* init timer thread */ rt_system_timer_thread_init(); /* Add CPU usage to system */ cpu_usage_init(); #ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); #endif #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); #endif /* init application */ rt_application_init(); /* 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) { extern void cpu_usage_init(void); /* init board */ rt_hw_board_init(); /* show version */ rt_show_version(); /* init tick */ rt_system_tick_init(); /* init kernel object */ rt_system_object_init(); /* init timer system */ rt_system_timer_init(); #ifdef RT_USING_HEAP /* init memory system */ rt_system_heap_init((void*)STM32_SRAM_BEGIN, (void*)STM32_SRAM_END); #endif /* init scheduler system */ rt_system_scheduler_init(); /* initialize timer */ rt_system_timer_init(); /* init timer thread */ rt_system_timer_thread_init(); /* Add CPU usage to system */ cpu_usage_init(); #ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); #endif #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); #endif /* init application */ rt_application_init(); /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return; }
int cu_init(void) { cpu_usage_init(); return 0; }