f_mount() (http://www.elm-chan.org/fsw/ff/00index_e.html - third party libary) API is called from both mount() and unmount() Mbed OS APIs.

f_mount() is doing both initializing (via find_volume() -> disk_initialize() where disk_initialize api calls Mbed OS init() function)
underlying block device and register filesystem but in case of "unmount" calls this f_mount is doing deregister filesystem
and missed to a deinitializing block device. So added the Mbed OS "deint()" call in unmount API to deinitialize block device
as f_mount API doesn't have a way to call deinit().
pull/14137/head
Rajkumar Kanagaraj 2021-01-11 10:56:43 -08:00
parent 15de1aae18
commit a29e3cd5d8
1 changed files with 5 additions and 0 deletions

View File

@ -330,6 +330,11 @@ int FATFileSystem::unmount()
}
FRESULT res = f_mount(NULL, _fsid, 0);
int err = _ffs[_id]->deinit();
if (err) {
unlock();
return err;
}
_ffs[_id] = NULL;
_id = -1;
unlock();