fix: Update examples etc. to use esp_vfs_fat_register

Instead of deprecated esp_vfs_fat_register_cfg
This commit is contained in:
Adam Múdry
2026-02-20 13:12:44 +01:00
parent 092a5ba5a5
commit 785a018380
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -155,12 +155,12 @@ static esp_err_t esp_vfs_fat_mount_internal(const esp_vfs_fat_mount_config_t *mo
.fat_drive = drv, .fat_drive = drv,
.max_files = mount_config->max_files, .max_files = mount_config->max_files,
}; };
err = esp_vfs_fat_register_cfg(&conf, &fs); err = esp_vfs_fat_register(&conf, &fs);
*out_fs = fs; *out_fs = fs;
if (err == ESP_ERR_INVALID_STATE) { if (err == ESP_ERR_INVALID_STATE) {
// it's okay, already registered with VFS // it's okay, already registered with VFS
} else if (err != ESP_OK) { } else if (err != ESP_OK) {
ESP_LOGD(TAG, "esp_vfs_fat_register_cfg failed 0x(%x)", err); ESP_LOGD(TAG, "esp_vfs_fat_register failed 0x(%x)", err);
goto fail; goto fail;
} }
+4 -4
View File
@@ -177,11 +177,11 @@ esp_err_t esp_vfs_fat_spiflash_mount_rw_wl(const char* base_path,
.fat_drive = drv, .fat_drive = drv,
.max_files = mount_config->max_files, .max_files = mount_config->max_files,
}; };
ret = esp_vfs_fat_register_cfg(&conf, &fs); ret = esp_vfs_fat_register(&conf, &fs);
if (ret == ESP_ERR_INVALID_STATE) { if (ret == ESP_ERR_INVALID_STATE) {
// it's okay, already registered with VFS // it's okay, already registered with VFS
} else if (ret != ESP_OK) { } else if (ret != ESP_OK) {
ESP_LOGD(TAG, "esp_vfs_fat_register_cfg failed 0x(%x)", ret); ESP_LOGD(TAG, "esp_vfs_fat_register failed 0x(%x)", ret);
goto fail; goto fail;
} }
@@ -367,11 +367,11 @@ esp_err_t esp_vfs_fat_spiflash_mount_ro(const char* base_path,
.fat_drive = drv, .fat_drive = drv,
.max_files = mount_config->max_files, .max_files = mount_config->max_files,
}; };
ret = esp_vfs_fat_register_cfg(&conf, &fs); ret = esp_vfs_fat_register(&conf, &fs);
if (ret == ESP_ERR_INVALID_STATE) { if (ret == ESP_ERR_INVALID_STATE) {
// it's okay, already registered with VFS // it's okay, already registered with VFS
} else if (ret != ESP_OK) { } else if (ret != ESP_OK) {
ESP_LOGD(TAG, "esp_vfs_fat_register_cfg failed 0x(%x)", ret); ESP_LOGD(TAG, "esp_vfs_fat_register failed 0x(%x)", ret);
goto fail; goto fail;
} }
@@ -278,7 +278,7 @@ esp_err_t msc_host_vfs_register(struct usbh_msc *msc_class,
.fat_drive = drive, .fat_drive = drive,
.max_files = mount_config->max_files, .max_files = mount_config->max_files,
}; };
ret = esp_vfs_fat_register_cfg(&conf, &fs); ret = esp_vfs_fat_register(&conf, &fs);
ESP_GOTO_ON_ERROR(ret, fail, TAG, "Failed to register filesystem, error=%s", esp_err_to_name(ret)); ESP_GOTO_ON_ERROR(ret, fail, TAG, "Failed to register filesystem, error=%s", esp_err_to_name(ret));
vfs->fs = fs; vfs->fs = fs;