MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / mnt_init

Function mnt_init

bsp/ht32/ht32f12366/applications/test.c:802–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800#endif
801#ifdef BSP_USING_SDIO
802int mnt_init(void)
803{
804 rt_device_t dev = RT_NULL;
805 char dev_name[] = BSP_USING_SDIO_NAME;
806 rt_thread_mdelay(1000);
807
808 dev = rt_device_find(dev_name);
809 if(dev)
810 {
811 if(dfs_mount("sd0","/","elm",0,0) == RT_EOK)
812 {
813 rt_kprintf("dfs mount success!\r\n");
814 }
815 else
816 {
817 rt_kprintf("dfs mount failed!\r\n");
818 rt_kprintf("Formatting the SD card!\r\n");
819 dfs_mkfs("elm",dev_name);
820 if(dfs_mount("sd0","/","elm",0,0) == RT_EOK)
821 {
822 rt_kprintf("dfs mount success!\r\n");
823 }
824 else
825 {
826 rt_kprintf("dfs mount failed!\r\n");
827 rt_kprintf("Exit SD card mount!\r\n");
828 }
829 }
830 }
831 return 0;
832}
833INIT_FS_EXPORT(mnt_init);
834#endif /* BSP_USING_SDIO */
835#endif /* BSP_USING_TEST */

Callers

nothing calls this directly

Calls 5

rt_thread_mdelayFunction · 0.85
rt_device_findFunction · 0.85
rt_kprintfFunction · 0.85
dfs_mountFunction · 0.50
dfs_mkfsFunction · 0.50

Tested by

no test coverage detected