1 /*
2 * Copyright (c) 2006-2021, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2017-5-30 bernard the first version
9 */
10
11 #include <rtthread.h>
12
13 #ifdef BSP_USING_SDIO
14 #include <dfs_fs.h>
15
mnt_init(void)16 int mnt_init(void)
17 {
18 rt_thread_delay(RT_TICK_PER_SECOND/100);
19 if (dfs_mount("sd1", "/", "ext", 0, 0) == 0)
20 {
21 rt_kprintf("file system initialization done!\n");
22 }
23 else if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
24 {
25 rt_kprintf("file system initialization done!\n");
26 }
27
28 #ifdef RT_USING_DFS_ROMFS
29 mkdir("/rom", 0777);
30 extern const struct romfs_dirent romfs_root;
31 if (dfs_mount(RT_NULL, "/rom", "rom", 0, &romfs_root) == 0)
32 {
33 rt_kprintf("ROM File System initialized!\n");
34 }
35 #endif
36
37 return 0;
38 }
39 INIT_ENV_EXPORT(mnt_init);
40 #endif
41