/* thread phase init */ void rt_init_thread_entry(void *parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS { extern void ff_convert_init(); /* init the device filesystem */ dfs_init(); /* init the elm FAT filesystam*/ elm_init(); /* mount spi flash fat as root directory */ if (dfs_mount("spi0", "/", "elm", 0, 0) == 0) { rt_kprintf("SPI File System initialized!\n"); /* mount sd card fat partition 1 as SD directory */ if (dfs_mount("sd0", "/SD", "elm", 0, 0) == 0) rt_kprintf("SD File System initialized!\n"); else rt_kprintf("SD File System init failed!\n"); } else rt_kprintf("SPI File System init failed!\n"); #ifdef RT_DFS_ELM_USE_LFN ff_convert_init(); #endif } #endif load_setup(); /* RTGUI Initialization */ #ifdef RT_USING_RTGUI { extern void rt_hw_key_init(void); extern void remote_init(void); extern void rtgui_touch_hw_init(void); radio_rtgui_init(); rt_hw_key_init(); rtgui_touch_hw_init(); remote_init(); } #endif /* set default setup */ { extern void vol(uint16_t v); extern void brightness_set(unsigned int value); vol(radio_setup.default_volume); brightness_set(radio_setup.lcd_brightness); } /* start RTC */ rt_hw_rtc_init(); /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); extern void rt_hw_dm9000_init(void); eth_system_device_init(); /* register ethernetif device */ rt_hw_dm9000_init(); /* init all device */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif #if STM32_EXT_SRAM /* init netbuf worker */ net_buf_init(320 * 1024); #endif }
/* thread phase init */ void rt_init_thread_entry(void *parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS { extern void ff_convert_init(); /* init the device filesystem */ dfs_init(); /* init the elm FAT filesystam*/ elm_init(); /* mount sd card fat partition 1 as SD directory */ if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) rt_kprintf("SD File System initialized!\n"); else rt_kprintf("SD File System init failed!\n"); #ifdef RT_DFS_ELM_USE_LFN ff_convert_init(); #endif } #endif /* load_setup(); */ /* RTGUI Initialization */ #ifdef RT_USING_RTGUI { extern void rt_hw_key_init(void); extern void remote_init(void); extern void rtgui_touch_hw_init(void); radio_rtgui_init(); rt_hw_key_init(); rtgui_touch_hw_init(); remote_init(); brightness_set(radio_setup.lcd_brightness); //PCM1770_VolumeSet(radio_setup.default_volume); } #endif /* start RTC */ rt_hw_rtc_init(); /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); extern void rt_hw_dm9000_init(void); eth_system_device_init(); /* register ethernetif device */ rt_hw_dm9000_init(); /* init all device */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif #if STM32_EXT_SRAM /* init netbuf worker */ net_buf_init(320 * 1024); #endif /* TODO(CXF): start ftp and agent */ ftpd_start(); }