mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fatfs: fix deinit not called for SDSPI host
Closes https://github.com/espressif/esp-idf/issues/1362
This commit is contained in:
parent
28e4162dd2
commit
ae30d1bc7b
@ -139,7 +139,7 @@ esp_err_t esp_vfs_fat_sdmmc_mount(const char* base_path,
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
sdmmc_host_deinit();
|
host_config->deinit();
|
||||||
free(workbuf);
|
free(workbuf);
|
||||||
if (fs) {
|
if (fs) {
|
||||||
f_mount(NULL, drv, 0);
|
f_mount(NULL, drv, 0);
|
||||||
@ -160,10 +160,11 @@ esp_err_t esp_vfs_fat_sdmmc_unmount()
|
|||||||
char drv[3] = {(char)('0' + s_pdrv), ':', 0};
|
char drv[3] = {(char)('0' + s_pdrv), ':', 0};
|
||||||
f_mount(0, drv, 0);
|
f_mount(0, drv, 0);
|
||||||
// release SD driver
|
// release SD driver
|
||||||
|
esp_err_t (*host_deinit)() = s_card->host.deinit;
|
||||||
ff_diskio_unregister(s_pdrv);
|
ff_diskio_unregister(s_pdrv);
|
||||||
free(s_card);
|
free(s_card);
|
||||||
s_card = NULL;
|
s_card = NULL;
|
||||||
sdmmc_host_deinit();
|
(*host_deinit)();
|
||||||
esp_err_t err = esp_vfs_fat_unregister_path(s_base_path);
|
esp_err_t err = esp_vfs_fat_unregister_path(s_base_path);
|
||||||
free(s_base_path);
|
free(s_base_path);
|
||||||
s_base_path = NULL;
|
s_base_path = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user