Merge pull request #1193 from liu2guang/master

[elm] Fixed elm device unmount error when mounting multiple elm devices.
This commit is contained in:
Bernard Xiong 2018-01-25 17:30:58 +08:00 committed by GitHub
commit e38e996e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -182,6 +182,7 @@ int dfs_elm_unmount(struct dfs_filesystem *fs)
FATFS *fat; FATFS *fat;
FRESULT result; FRESULT result;
int index; int index;
char logic_nbr[2] = {'0',':'};
fat = (FATFS *)fs->data; fat = (FATFS *)fs->data;
@ -192,7 +193,8 @@ int dfs_elm_unmount(struct dfs_filesystem *fs)
if (index == -1) /* not found */ if (index == -1) /* not found */
return -ENOENT; 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) if (result != FR_OK)
return elm_result_to_dfs(result); return elm_result_to_dfs(result);