/* thread phase init */ void rt_init_thread_entry(void *parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); /* init the efsl filesystam*/ efsl_init(); /* mount sd card fat partition 1 as root directory */ if (dfs_mount("sd0", "/", "efs", 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); eth_system_device_init(); /* register AT91 EMAC device */ sam7xether_register("E0"); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif }
void init_thread(void* parameter) { eth_system_device_init(); lwip_system_init(); dfs_init(); elm_init(); rt_hw_uart_init("uart0", 0); rt_console_set_device("uart0"); rt_kprintf("rt-thread system start!\r\n"); finsh_system_init(); rt_hw_dflash_init("dflash0"); dfs_mount("dflash0", "/", "elm", 0, 0); rt_hw_enet_phy_init(); rt_kprintf("waitting for connection..."); /* tcp server demo */ extern void tcpserv(void* parameter); tcpserv(RT_NULL); }
void rt_init_thread_entry(void* parameter) { /* GDB STUB */ #ifdef RT_USING_GDB gdb_set_device("uart6"); gdb_start(); #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); /* register ethernetif device */ eth_system_device_init(); rt_hw_stm32_eth_init(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif rt_hw_lcd_init("lcd", "spi1"); //GUI_Init(); /* ³õʼ»¯ST-emwin */ while (1) { rt_kprintf("thread1\r\n"); MainTask(); } }
void rt_init_thread_entry(void* parameter) { /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); /* register ethernetif device */ eth_system_device_init(); rt_hw_stm32_eth_init(); /* re-init device driver */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif //FS //GUI }
void init_tcpip_lwip_stack(void) { extern void lwip_system_init(void); extern rt_err_t eth_system_device_init(void); /* register ethernetif device */ eth_system_device_init(); RT_APPS_INIT_DEBUG(("eth_system_device_init() succ!\n")); rt_hw_stm32_eth_init(); RT_APPS_INIT_DEBUG(("func:%s, line:%u, eie:0x%x!\n", __FUNCTION__, __LINE__, enc28j60_read(EIE))); /* to assure Ethernet Phy work well */ //lihao //Ethernet_Security(); RT_APPS_INIT_DEBUG(("func:%s, line:%u!\n", __FUNCTION__, __LINE__)); /* re-init device driver */ rt_device_init_all(); RT_APPS_INIT_DEBUG(("func:%s, line:%u, eie:0x%x!\n", __FUNCTION__, __LINE__, enc28j60_read(EIE))); /* init lwip system */ lwip_system_init(); RT_APPS_INIT_LOG(("TCP/IP initialized, eie:0x%x!\n", enc28j60_read(EIE))); /* init net apps */ #if RT_USING_HTTPSERVER_RAW httpd_init(); #endif #if RT_USING_TELNETD telnetd_init(); #endif }
void rt_init_thread_entry(void* parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT /* init the elm chan FatFs 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 initialzation failed!\n"); #endif } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); #ifdef STM32F10X_CL extern void rt_hw_stm32_eth_init(void); #endif /* register ethernetif device */ eth_system_device_init(); #ifdef STM32F10X_CL rt_hw_stm32_eth_init(); #else /* STM32F103 */ #if STM32_ETH_IF == 0 rt_hw_enc28j60_init(); #elif STM32_ETH_IF == 1 rt_hw_dm9000_init(); #endif #endif /* re-init device driver */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif }
/* thread phase init */ void rt_init_thread_entry(void *parameter) { /* initialize platform */ platform_init(); #ifdef RT_USING_LWIP /* register Ethernet interface device */ lpc17xx_emac_hw_init(); /* initialize lwip stack */ /* register ethernetif device */ eth_system_device_init(); /* initialize lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); #endif /* Filesystem Initialization */ #ifdef RT_USING_DFS rt_hw_sdcard_init(); /* initialize the device file system */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT /* initialize the elm chan FatFS file system*/ elm_init(); #endif /* 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 #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif }
void rt_init_thread_entry(void* parameter) { { extern void rt_platform_init(void); rt_platform_init(); } /* Filesystem Initialization */ #if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) /* initialize the device file system */ dfs_init(); /* initialize the elm chan FatFS file system*/ 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 initialzation failed!\n"); } #endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */ #ifdef RT_USING_LWIP /* initialize lwip stack */ /* register ethernetif device */ eth_system_device_init(); /* initialize lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif //led_tog_init(); }
/* thread phase init */ void rt_init_thread_entry(void *parameter) { /* 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"); sntp_init(); } #endif }
void rt_init_thread_entry(void* parameter) { rt_i2c_core_init(); rt_hw_i2c_init(); rt_hw_spi_init(); //³õʼ»¯Ä£ÄâI2C //I2C_Soft_Init(); rt_hw_mpu6050_init("i2c1", MPU6050_DEFAULT_ADDRESS); rt_motors_hw_init(); /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); /* register ethernetif device */ eth_system_device_init(); /* initialize wifi interface */ rt_hw_wifi_init("spi10"); /* init lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); set_if("w0","192.168.3.9","192.168.3.1","255.255.255.0"); rw009_join("rtthread_11n","rtthread_finsh"); } #endif apps_copter_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif }
void rt_init_thread_entry(void* parameter) { /* GDB STUB */ #ifdef RT_USING_GDB gdb_set_device("uart6"); gdb_start(); #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); /* register ethernetif device */ eth_system_device_init(); rt_hw_stm32_eth_init(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #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 }
/** * RT-Thread Components Initialization */ void rt_components_init(void) { #ifdef RT_USING_MODULE rt_system_module_init(); #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_LWIP /* initialize lwip stack */ /* register ethernetif device */ eth_system_device_init(); /* initialize lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); #endif #ifdef RT_USING_DFS /* initialize the device file system */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT /* initialize the elm chan FatFS file system*/ elm_init(); #endif #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP) /* initialize NFSv3 client file system */ nfs_init(); #endif #ifdef RT_USING_DFS_YAFFS2 dfs_yaffs2_init(); #endif #ifdef RT_USING_DFS_UFFS dfs_uffs_init(); #endif #ifdef RT_USING_DFS_JFFS2 dfs_jffs2_init(); #endif #ifdef RT_USING_DFS_ROMFS dfs_romfs_init(); #endif #ifdef RT_USING_DFS_DEVFS devfs_init(); #endif #endif /* end of RT_USING_DFS */ #ifdef RT_USING_NEWLIB libc_system_init(RT_CONSOLE_DEVICE_NAME); #else /* the pthread system initialization will be initiallized in libc */ #ifdef RT_USING_PTHREADS pthread_system_init(); #endif #endif #ifdef RT_USING_RTGUI rtgui_system_server_init(); #endif #ifdef RT_USING_USB_HOST rt_usb_host_init(); #endif return; }
/** * This function will startup RT-Thread RTOS. */ void rtthread_startup(void) { /* init hardware interrupt */ rt_hw_interrupt_init(); /* init board */ rt_hw_board_init(); 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*)0x00210000); #elif __ICCARM__ rt_system_heap_init(__segment_end("HEAP"), (void*)0x00210000); #else rt_system_heap_init(&__bss_end, 0x00210000); #endif #endif /* init scheduler system */ rt_system_scheduler_init(); #ifdef RT_USING_HOOK /* if the hook is used */ /* set idle thread hook */ rt_thread_idle_sethook(led_flash); #endif #ifdef RT_USING_DEVICE /* init hardware serial device */ rt_hw_serial_init(); #ifdef RT_USING_LWIP eth_system_device_init(); /* register AT91 EMAC device */ sam7xether_register("E0"); #endif #ifdef RT_USING_DFS rt_hw_sdcard_init(); #endif /*init all registed devices*/ rt_device_init_all(); #endif /* init application */ rt_application_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device("uart1"); #endif /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ; }
/* 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 }
void rt_init_thread_entry(void* parameter) { { extern void rt_platform_init(void); rt_platform_init(); } /* Filesystem Initialization */ #if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) /* initialize the device file system */ dfs_init(); /* initialize the elm chan FatFS file system*/ 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 initialzation failed!\n"); } #endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */ #ifdef RT_USING_LWIP /* initialize lwip stack */ /* register ethernetif device */ eth_system_device_init(); /* initialize lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_RTGUI { rt_device_t device; struct rt_device_rect_info info; extern int rtgui_system_server_init(void); rtgui_system_server_init(); device = rt_device_find("lcd"); /* re-set graphic device */ rtgui_graphic_set_device(device); rtgui_system_server_init(); /* ´¥ÃþÆÁУ׼ calibration();*/ /* ²âÊÔ´¥ÃþÆÁ°´Å¥ ¼°¼òÒ×¼ÆËãÆ÷ ui_button();*/ /*ÔËÐÐdemo */ application_init(); } #endif }
void rt_init_thread_entry(void *parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); #if defined(RT_USING_DFS_ELMFAT) /* init the elm chan FatFs 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 initialzation failed!\n"); #endif #if defined(RT_USING_DFS_ROMFS) dfs_romfs_init(); if (dfs_mount(RT_NULL, "/rom", "rom", 0, &romfs_root) == 0) { rt_kprintf("ROM File System initialized!\n"); } else rt_kprintf("ROM File System initialzation failed!\n"); #endif #if defined(RT_USING_DFS_DEVFS) devfs_init(); if (dfs_mount(RT_NULL, "/dev", "devfs", 0, 0) == 0) rt_kprintf("Device File System initialized!\n"); else rt_kprintf("Device File System initialzation failed!\n"); #ifdef RT_USING_NEWLIB /* init libc */ libc_system_init("uart0"); #endif #endif #if defined(RT_USING_DFS) && defined(RT_USING_LWIP) && defined(RT_USING_DFS_NFS) /* NFSv3 Initialization */ nfs_init(); if (dfs_mount(RT_NULL, "/nfs", "nfs", 0, RT_NFS_HOST_EXPORT) == 0) rt_kprintf("NFSv3 File System initialized!\n"); else rt_kprintf("NFSv3 File System initialzation failed!\n"); #endif #if defined(RT_USING_DFS_UFFS) /* init the uffs filesystem */ dfs_uffs_init(); /* mount flash device as flash directory */ if (dfs_mount("nand0", "/nand0", "uffs", 0, 0) == 0) rt_kprintf("UFFS File System initialized!\n"); else rt_kprintf("UFFS File System initialzation failed!\n"); #endif } #endif #ifdef RT_USING_RTGUI { extern void rtgui_system_server_init(void); rt_device_t lcd; /* init lcd */ rt_hw_lcd_init(); /* init touch panel */ rtgui_touch_hw_init(); /* init keypad */ rt_hw_key_init(); /* find lcd device */ lcd = rt_device_find("lcd"); /* set lcd device as rtgui graphic driver */ rtgui_graphic_set_device(lcd); /* initalize rtgui system server */ rtgui_system_server_init(); } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); eth_system_device_init(); /* register ethernetif device */ rt_hw_dm9000_init(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif #ifdef RT_USING_FTK { rt_thread_t ftk_thread; /* init lcd */ rt_hw_lcd_init(); /* init touch panel */ rtgui_touch_hw_init(); /* init keypad */ rt_hw_key_init(); /* create ftk thread */ ftk_thread = rt_thread_create("ftk", rt_ftk_thread_entry, RT_NULL, 10 * 1024, 8, 20); /* startup ftk thread */ if (ftk_thread != RT_NULL) rt_thread_startup(ftk_thread); } #endif }
/** * RT-Thread Components Initialization */ void rt_components_init(void) { #ifdef RT_USING_MODULE rt_system_module_init(); #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_LWIP /* initialize lwip stack */ /* register ethernetif device */ eth_system_device_init(); /* initialize lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); #endif #ifdef RT_USING_DFS /* initialize the device file system */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT /* initialize the elm chan FatFS file systam*/ elm_init(); #endif #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP) extern void nfs_init(void); /* initialize NFSv3 client file system */ nfs_init(); #endif #ifdef RT_USING_DFS_YAFFS2 yaffs2_init(); #endif #ifdef RT_USING_DFS_UFFS uffs_init(); #endif #ifdef RT_USING_DFS_JFFS2 jffs2_init(); #endif #ifdef RT_USING_DFS_ROMFS romfs_init(); #endif #ifdef RT_USING_DFS_DEVFS devfs_init(); #endif #endif #ifdef RT_USING_NEWLIB libc_system_init(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_PTHREADS pthread_system_init(); #endif #ifdef RT_USING_RTGUI rtgui_system_server_init(); #endif return; }
/** * This function will startup RT-Thread RTOS. */ void rtthread_startup(void) { /* init hardware interrupt */ rt_hw_interrupt_init(); /* init board */ rt_hw_board_init(); /* init tick */ rt_system_tick_init(); /* init kernel object */ rt_system_object_init(); rt_show_version(); /* 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*)0x40008000); #else /* init memory system */ rt_system_heap_init((void*)&__bss_end, (void*)0x40008000); #endif #endif /* init scheduler system */ rt_system_scheduler_init(); #ifdef RT_USING_DEVICE #ifdef RT_USING_DFS /* init sd card */ rt_hw_sdcard_init(); #endif #ifdef RT_USING_LWIP eth_system_device_init(); /* init ethernetif device */ rt_hw_dm9000_init(); #endif /* init hardware serial device */ rt_hw_serial_init(); #endif /* init application */ rt_application_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device("uart1"); #endif /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ; }
/** * RT-Thread Components Initialization */ void rt_components_init(void) { #ifndef _MSC_VER #ifdef RT_DEBUG_INIT int result; const struct rt_init_desc *desc; rt_kprintf("do components intialization.\n"); for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++) { rt_kprintf("initialize %s", desc->fn_name); result = desc->fn(); rt_kprintf(":%d done\n", result); } #else const init_fn_t *fn_ptr; for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++) { (*fn_ptr)(); } #endif #else #ifdef RT_USING_MODULE rt_system_module_init(); #endif #ifdef RT_USING_FINSH /* initialize finsh */ finsh_system_init(); finsh_set_device(RT_CONSOLE_DEVICE_NAME); #endif #ifdef RT_USING_LWIP /* initialize lwip stack */ /* register ethernetif device */ eth_system_device_init(); /* initialize lwip system */ lwip_system_init(); rt_kprintf("TCP/IP initialized!\n"); #endif #ifdef RT_USING_DFS /* initialize the device file system */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT /* initialize the elm chan FatFS file system*/ elm_init(); #endif #if defined(RT_USING_DFS_NFS) && defined(RT_USING_LWIP) /* initialize NFSv3 client file system */ nfs_init(); #endif #ifdef RT_USING_DFS_YAFFS2 dfs_yaffs2_init(); #endif #ifdef RT_USING_DFS_UFFS dfs_uffs_init(); #endif #ifdef RT_USING_DFS_JFFS2 dfs_jffs2_init(); #endif #ifdef RT_USING_DFS_ROMFS dfs_romfs_init(); #endif #ifdef RT_USING_DFS_RAMFS dfs_ramfs_init(); #endif #ifdef RT_USING_DFS_DEVFS devfs_init(); #endif #endif /* end of RT_USING_DFS */ #ifdef RT_USING_NEWLIB libc_system_init(RT_CONSOLE_DEVICE_NAME); #else /* the pthread system initialization will be initiallized in libc */ #ifdef RT_USING_PTHREADS pthread_system_init(); #endif #endif #ifdef RT_USING_RTGUI rtgui_system_server_init(); #endif #ifdef RT_USING_USB_HOST rt_usb_host_init(); #endif #endif }
void rt_init_thread_entry(void* parameter) { rt_hw_sdcard_init(); /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); #if defined(RT_USING_DFS_ELMFAT) /* init the elm chan FatFs 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 initialzation failed!\n"); #endif #if defined(RT_USING_DFS_ROMFS) dfs_romfs_init(); if (dfs_mount(RT_NULL, "/rom", "rom", 0, &romfs_root) == 0) { rt_kprintf("ROM File System initialized!\n"); } else rt_kprintf("ROM File System initialzation failed!\n"); #endif #if defined(RT_USING_DFS_DEVFS) devfs_init(); if (dfs_mount(RT_NULL, "/dev", "devfs", 0, 0) == 0) rt_kprintf("Device File System initialized!\n"); else rt_kprintf("Device File System initialzation failed!\n"); #ifdef RT_USING_NEWLIB /* init libc */ libc_system_init("uart0"); #endif #endif #if defined(RT_USING_DFS_UFFS) { /* init the uffs filesystem */ dfs_uffs_init(); /* mount flash device as flash directory */ if(dfs_mount("nand0", "/nand0", "uffs", 0, 0) == 0) rt_kprintf("UFFS File System initialized!\n"); else rt_kprintf("UFFS File System initialzation failed!\n"); } #endif } #endif #ifdef RT_USING_RTGUI { /* init lcd */ rt_hw_lcd_init(); /* init touch panel */ rtgui_touch_hw_init(); /* init keypad */ rt_hw_key_init(); /* re-init device driver */ rt_device_init_all(); /* startup rtgui */ //rtgui_startup(); } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); eth_system_device_init(); /* register ethernetif device */ rt_hw_dm9000_init(); /* re-init device driver */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif #ifdef RT_USING_FTK { rt_thread_t ftk_thread; int FTK_MAIN(int argc, char* argv[]); /* init lcd */ rt_hw_lcd_init(); /* init touch panel */ rtgui_touch_hw_init(); /* init keypad */ rt_hw_key_init(); /* re-init device driver */ rt_device_init_all(); /* create ftk thread */ ftk_thread = rt_thread_create("ftk", FTK_MAIN, RT_NULL, 10 * 1024, 8, 20); /* startup ftk thread */ if(ftk_thread != RT_NULL) rt_thread_startup(ftk_thread); } #endif }
void rt_init_thread_entry(void* parameter) { platform_init(); /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); #if defined(RT_USING_DFS_ELMFAT) /* init the elm chan FatFs filesystam*/ elm_init(); #endif #if defined(RT_USING_DFS_ROMFS) dfs_romfs_init(); if (dfs_mount(RT_NULL, "/rom", "rom", 0, &romfs_root) == 0) { rt_kprintf("ROM File System initialized!\n"); } else rt_kprintf("ROM File System initialzation failed!\n"); #endif #if defined(RT_USING_DFS_DEVFS) devfs_init(); if (dfs_mount(RT_NULL, "/dev", "devfs", 0, 0) == 0) rt_kprintf("Device File System initialized!\n"); else rt_kprintf("Device File System initialzation failed!\n"); #ifdef RT_USING_NEWLIB /* init libc */ libc_system_init(RT_CONSOLE_DEVICE_NAME); #endif #endif #if defined(RT_USING_DFS_UFFS) { /* init the uffs filesystem */ dfs_uffs_init(); /* mount flash device as flash directory */ if(dfs_mount("nand0", "/nand0", "uffs", 0, 0) == 0) rt_kprintf("UFFS File System initialized!\n"); else rt_kprintf("UFFS File System initialzation failed!\n"); } #endif #ifdef RT_USING_I2C { rt_i2c_core_init(); davinci_i2c_init("I2C1"); } #endif #ifdef RT_USING_SPI { rt_hw_spi_init(); } #endif #ifdef RT_USING_SDIO rt_mmcsd_core_init(); rt_mmcsd_blk_init(); rt_hw_mmcsd_init(); rt_thread_delay(RT_TICK_PER_SECOND*2); /* 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 initialzation failed!%d\n", rt_get_errno()); #endif } #endif #ifdef RT_USING_LWIP { /* register ethernetif device */ eth_system_device_init(); rt_hw_davinci_emac_init(); /* init lwip system */ lwip_system_init(); } #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*)LM3S_SRAM_END); #elif __ICCARM__ rt_system_heap_init(__segment_end("HEAP"), (void*)LM3S_SRAM_END); #else /* init memory system */ rt_system_heap_init((void*)&__bss_end, (void*)LM3S_SRAM_END); #endif #endif #ifdef RT_USING_MODULE /* init module system */ rt_system_module_init(); #endif /* init scheduler system */ rt_system_scheduler_init(); #ifdef RT_USING_LWIP eth_system_device_init(); /* register ethernetif device */ rt_hw_luminaryif_init(); #endif /* init hardware serial device */ rt_hw_serial_init(); #ifdef RT_USING_DFS /* init sd card device */ rt_hw_sdcard_init(); #endif /* init application */ rt_application_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); #ifdef RT_USING_DEVICE finsh_set_device("uart1"); #endif #endif /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ; }
void rt_init_thread_entry(void* parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS { /* init the device filesystem */ dfs_init(); #ifdef RT_USING_DFS_ELMFAT /* init the elm chan FatFs 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 initialzation failed!\n"); #endif } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); /* register ethernetif device */ eth_system_device_init(); #ifdef STM32F10X_CL rt_hw_stm32_eth_init(); #else /* STM32F103 */ #if STM32_ETH_IF == 0 rt_hw_enc28j60_init(); #elif STM32_ETH_IF == 1 rt_hw_dm9000_init(); #endif #endif /* re-init device driver */ 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 rt_hw_lcd_init(); extern void rtgui_touch_hw_init(void); rt_device_t lcd; /* init lcd */ rt_hw_lcd_init(); /* init touch panel */ rtgui_touch_hw_init(); /* re-init device driver */ rt_device_init_all(); /* find lcd device */ lcd = rt_device_find("lcd"); /* set lcd device as rtgui graphic driver */ rtgui_graphic_set_device(lcd); /* init rtgui system server */ rtgui_system_server_init(); } #endif /* #ifdef RT_USING_RTGUI */ }
void rt_init_thread_entry(void* parameter) { #ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP { extern void lwip_sys_init(void); /* register ethernetif device */ eth_system_device_init(); rt_hw_stm32_eth_init(); /* re-init device driver */ rt_device_init_all(); /* init lwip system */ lwip_sys_init(); rt_kprintf("TCP/IP initialized!\n"); } #endif //FS #ifdef RT_USING_DFS dfs_init(); #ifdef RT_USING_MTD_NAND nand_mtd_init(); dfs_uffs_init(); if (dfs_mount("psram0", "/", "uffs", 0, 0) == 0) { rt_kprintf("uffs mount / partion ok\n"); } else rt_kprintf("uffs mount / partion failed!\n"); #endif #endif rt_hw_lcd_init(); //GUI #ifdef RT_USING_RTGUI { extern void rt_hw_lcd_init(); //extern void rtgui_touch_hw_init(void); rt_device_t lcd; /* init lcd */ rt_hw_lcd_init(); /* init touch panel */ //rtgui_touch_hw_init(); /* find lcd device */ lcd = rt_device_find("lcd"); /* set lcd device as rtgui graphic driver */ rtgui_graphic_set_device(lcd); #ifndef RT_USING_COMPONENTS_INIT /* init rtgui system server */ rtgui_system_server_init(); #endif //calibration_set_restore(cali_setup); //calibration_set_after(cali_store); //calibration_init(); } #endif /* #ifdef RT_USING_RTGUI */ }
/* 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(); }