[elm] Fixed elm device unmount error when mounting multiple elm devices.
This commit is contained in:
parent
6f117e8e36
commit
e63de3f66b
|
@ -182,6 +182,7 @@ int dfs_elm_unmount(struct dfs_filesystem *fs)
|
|||
FATFS *fat;
|
||||
FRESULT result;
|
||||
int index;
|
||||
char logic_nbr[2] = {'0',':'};
|
||||
|
||||
fat = (FATFS *)fs->data;
|
||||
|
||||
|
@ -192,7 +193,8 @@ int dfs_elm_unmount(struct dfs_filesystem *fs)
|
|||
if (index == -1) /* not found */
|
||||
return -ENOENT;
|
||||
|
||||
result = f_mount(RT_NULL, "", (BYTE)index);
|
||||
logic_nbr[0] = '0' + index;
|
||||
result = f_mount(RT_NULL, logic_nbr, (BYTE)1);
|
||||
if (result != FR_OK)
|
||||
return elm_result_to_dfs(result);
|
||||
|
||||
|
|
Loading…
Reference in New Issue