Skip to content

Commit f19da94

Browse files
Unbear-HzRbb666
authored andcommitted
[fix][dfs] 修正 elmfat mkfs 中 f_mount 的错误传参
1 parent e01b14c commit f19da94

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ int dfs_elm_mkfs(rt_device_t dev_id, const char *fs_name)
264264
* just fill the FatFS[index] in elm fatfs to make mkfs work.
265265
*/
266266
logic_nbr[0] = '0' + index;
267-
f_mount(fat, logic_nbr, (BYTE)index);
267+
f_mount(fat, logic_nbr, 0); /* opt=0: delayed mount, just register FATFS object */
268268
}
269269
}
270270
else
@@ -284,7 +284,7 @@ int dfs_elm_mkfs(rt_device_t dev_id, const char *fs_name)
284284
/* check flag status, we need clear the temp driver stored in disk[] */
285285
if (flag == FSM_STATUS_USE_TEMP_DRIVER)
286286
{
287-
f_mount(RT_NULL, logic_nbr, (BYTE)index);
287+
f_mount(RT_NULL, logic_nbr, 0);
288288
rt_free(fat);
289289
disk[index] = RT_NULL;
290290
/* close device */

‎components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ int dfs_elm_mkfs(rt_device_t dev_id, const char *fs_name)
302302
* just fill the FatFS[index] in elm fatfs to make mkfs work.
303303
*/
304304
logic_nbr[0] = '0' + index;
305-
f_mount(fat, logic_nbr, (BYTE)index);
305+
f_mount(fat, logic_nbr, 0); /* opt=0: delayed mount, just register FATFS object */
306306
}
307307
}
308308
else
@@ -322,7 +322,7 @@ int dfs_elm_mkfs(rt_device_t dev_id, const char *fs_name)
322322
/* check flag status, we need clear the temp driver stored in disk[] */
323323
if (flag == FSM_STATUS_USE_TEMP_DRIVER)
324324
{
325-
f_mount(RT_NULL, logic_nbr, (BYTE)index);
325+
f_mount(RT_NULL, logic_nbr, 0);
326326
rt_free(fat);
327327
disk[index] = RT_NULL;
328328
/* close device */

0 commit comments

Comments
 (0)