1 #include <rtthread.h> 2 3 #ifdef RT_USING_DFS 4 #include <dfs_fs.h> 5 #include "dfs_ramfs.h" 6 mnt_init(void)7int mnt_init(void) 8 { 9 rt_uint32_t tryCnt = 5; 10 rt_device_t dev; 11 12 while(tryCnt--) 13 { 14 dev = rt_device_find("sd0"); 15 if(dev != RT_NULL) 16 { 17 break; 18 } 19 rt_thread_mdelay(500); 20 } 21 22 if(dfs_mount("sd0", "/", "elm", 0, 0) == 0) 23 { 24 rt_kprintf("File System initialized!\n"); 25 } 26 else 27 { 28 rt_kprintf("File System initialzation failed!\n"); 29 } 30 31 return RT_EOK; 32 } 33 INIT_ENV_EXPORT(mnt_init); 34 #endif 35 36