fix(vfs): FATFS mount immediately after format if mount failed

This commit is contained in:
Adam Múdry 2024-07-23 15:44:40 +02:00
parent 0a615a6783
commit 567cf951bd
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ static esp_err_t mount_to_vfs_fat(const esp_vfs_fat_mount_config_t *mount_config
}
ESP_LOGW(TAG, "mounting again");
res = f_mount(fs, drv, 0);
res = f_mount(fs, drv, 1);
if (res != FR_OK) {
err = ESP_FAIL;
ESP_LOGD(TAG, "f_mount failed after formatting (%d)", res);

View File

@ -93,7 +93,7 @@ esp_err_t esp_vfs_fat_spiflash_mount_rw_wl(const char* base_path,
free(workbuf);
workbuf = NULL;
ESP_LOGI(TAG, "Mounting again");
fresult = f_mount(fs, drv, 0);
fresult = f_mount(fs, drv, 1);
if (fresult != FR_OK) {
result = ESP_FAIL;
ESP_LOGE(TAG, "f_mount failed after formatting (%d)", fresult);