void rt_init_thread_entry(void* parameter) { #ifdef RT_USING_LWIP /* initialize eth interface */ lpc_emac_hw_init(); #endif #ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); #endif { extern rt_err_t mci_hw_init(const char *device_name); mci_hw_init("sd0"); } /* Filesystem Initialization */ #ifdef RT_USING_DFS { #ifdef RT_USING_DFS_ELMFAT /* mount sd card fat partition 1 as root directory */ if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) { rt_kprintf("File System initialized!\n"); #if (RT_DFS_ELM_USE_LFN != 0) && (defined RT_DFS_ELM_CODE_PAGE_FILE) { extern void ff_convert_init(void); ff_convert_init(); } #endif } else rt_kprintf("File System initialzation failed!\n"); #endif } #endif /* do some thing here. */ #if defined(RT_USING_DFS) && defined(RT_USING_LWIP) /* start ftp server */ rt_kprintf("ftp server begin...\n"); ftpd_start(); rt_kprintf("ftp server started!!\n"); #endif }
/* thread phase init */ void rt_init_thread_entry(void *parameter) { #ifdef RT_USING_SPI { extern void rt_hw_spi0_init(void); rt_hw_spi0_init(); } #endif #ifdef RT_USING_I2C { extern void rt_hw_i2c_init(void); rt_i2c_core_init(); rt_hw_i2c_init(); } #endif /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); /* init the elm FAT filesystam*/ elm_init(); /* mount sd card fat partition 1 as root directory */ if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) rt_kprintf("File System initialized!\n"); else rt_kprintf("File System init failed!\n"); } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); extern void lpc17xx_emac_hw_init(void); eth_system_device_init(); /* register ethernetif device */ lpc_emac_hw_init(); /* init all device */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif #ifdef RT_USING_RTGUI { extern void rtgui_system_server_init(void); extern void application_init(void); rt_device_t lcd; /* init lcd */ rt_hw_lcd_init(); /* re-init device driver */ rt_device_init_all(); /* find lcd device */ lcd = rt_device_find("lcd"); if (lcd != RT_NULL) { /* set lcd device as rtgui graphic driver */ rtgui_graphic_set_device(lcd); /* init rtgui system server */ rtgui_system_server_init(); rt_hw_joystick_init(); rtgui_touch_hw_init("spi20"); /* startup rtgui in demo of RT-Thread/GUI examples */ application_init(); } } #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(FINSH_DEVICE_NAME); #endif }
/* thread phase init */ void rt_init_thread_entry(void *parameter) { // #ifdef RT_USING_I2C // rt_i2c_core_init(); // rt_hw_i2c_init(); // #endif rt_hw_spi_init(); rt_system_module_init(); /* Filesystem Initialization */ #ifdef RT_USING_DFS { extern rt_err_t mci_hw_init(const char *device_name); /* initilize sd card */ mci_hw_init("sd0"); /* init the device filesystem */ dfs_init(); /* init the elm FAT filesystam*/ elm_init(); #ifdef RT_USING_NFTL { extern void rt_hw_mtd_nand_init(void); rt_hw_mtd_nand_init(); nftl_init(); nftl_mount(); // list_mem(); } #else /* mount sd card fat partition 1 as root directory */ if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) rt_kprintf("File System initialized!\n"); else rt_kprintf("File System init failed!\n"); #endif } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); eth_system_device_init(); /* register ethernetif device */ lpc_emac_hw_init(); /* init all device */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif #ifdef RT_USING_RTGUI { extern void realtouch_ui_init(void); extern void rt_hw_key_init(void); rt_device_t lcd; /* init lcd */ rt_hw_lcd_init(); /* re-init device driver */ rt_device_init_all(); /* find lcd device */ lcd = rt_device_find("lcd"); if (lcd != RT_NULL) { /* set lcd device as rtgui graphic driver */ rtgui_graphic_set_device(lcd); /* init rtgui system server */ rtgui_system_server_init(); rt_thread_delay(5); rt_hw_key_init(); rtgui_touch_hw_init("spi10"); /* startup rtgui realtouch ui */ realtouch_ui_init(); } } #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(FINSH_DEVICE_NAME); #endif }