diff options
| author | Meco Man <[email protected]> | 2022-06-01 12:44:06 -0400 |
|---|---|---|
| committer | guo <[email protected]> | 2022-06-16 10:30:16 +0800 |
| commit | ada0e8f1a1a19ef9bb840a52b3bd9b0209ac7987 (patch) | |
| tree | e76fb33ea2acfc6e8421d8ee45ea5ecccbc981fe | |
| parent | 808259135fe0c24e17c9f990bf28f9d13e1a04d1 (diff) | |
[simulator] improve init process
| -rw-r--r-- | bsp/simulator/applications/mnt.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/bsp/simulator/applications/mnt.c b/bsp/simulator/applications/mnt.c index a4a559404e..5c96c1a2a5 100644 --- a/bsp/simulator/applications/mnt.c +++ b/bsp/simulator/applications/mnt.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2017-04-03 Urey the first version + * 2022-06-01 Meco Man improve the init process */ #include <rtthread.h> #include <rtdevice.h> @@ -36,6 +37,9 @@ static int mnt_init(void) } if (dfs_mount("sd0", "/sd", "elm", 0, 0) == 0) +#else + if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) +#endif /* RT_USING_DFS_WINSHAREDIR */ { LOG_I("[sd0] File System on SD ('sd0') initialized!"); } @@ -45,7 +49,11 @@ static int mnt_init(void) LOG_W("[sd0] Try to format and re-mount..."); if (dfs_mkfs("elm", "sd0") == 0) { + #ifdef RT_USING_DFS_WINSHAREDIR if (dfs_mount("sd0", "/sd", "elm", 0, 0) == 0) + #else + if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) + #endif /* RT_USING_DFS_WINSHAREDIR */ { LOG_I("[sd0] File System on SD ('sd0') initialized!"); return 0; @@ -54,18 +62,7 @@ static int mnt_init(void) LOG_E("[sd0] File System on SD ('sd0') initialization failed!"); } -#else - if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) - { - LOG_I("[sd0] File System on sd initialized!"); - } - else - { - LOG_E("[sd0] File System on sd initialization failed!"); - } -#endif - return 0; } INIT_ENV_EXPORT(mnt_init); -#endif +#endif /* RT_USING_DFS */ |
