Skip to content

Commit 539adb0

Browse files
committed
refactor(spi_nand_flash): Use esp_vfs_fat_register_cfg instead of esp_vfs_fat_register
1 parent 1bc817a commit 539adb0

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

spi_nand_flash/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## [0.17.0]
1+
## [0.18.0]
2+
- fix: Update esp_vfs_fat_register prototype to esp_vfs_fat_register_cfg to align with ESP-IDF v6.0.
3+
The cfg version is now the primary API and remains aliased for compatibility.
4+
5+
## [0.17.0]
26
- fix: fix a compilation error caused by the missing freertos/FreeRTOS.h header when building with ESP-IDF v6.0 and later.
37
- update: improvements to the lower-level APIs following updates in esp_driver_spi.
48

spi_nand_flash/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.17.0"
1+
version: "0.18.0"
22
description: Driver for accessing SPI NAND Flash
33
url: https://github.com/espressif/idf-extra-components/tree/master/spi_nand_flash
44
issues: https://github.com/espressif/idf-extra-components/issues

spi_nand_flash/vfs/vfs_fat_spinandflash.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,17 @@ esp_err_t esp_vfs_fat_nand_mount(const char *base_path, spi_nand_flash_device_t
3838

3939
ESP_GOTO_ON_ERROR(spi_nand_flash_get_sector_size(nand_device, &sector_size), fail, TAG, "");
4040

41+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
42+
esp_vfs_fat_conf_t conf = {
43+
.base_path = base_path,
44+
.fat_drive = drv,
45+
.max_files = mount_config->max_files,
46+
};
47+
ESP_GOTO_ON_ERROR(esp_vfs_fat_register_cfg(&conf, &fs), fail, TAG, "esp_vfs_fat_register failed");
48+
#else
4149
ESP_GOTO_ON_ERROR(esp_vfs_fat_register(base_path, drv, mount_config->max_files, &fs),
4250
fail, TAG, "esp_vfs_fat_register failed");
51+
#endif
4352

4453
// Try to mount partition
4554
FRESULT fresult = f_mount(fs, drv, 1);

0 commit comments

Comments
 (0)