summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryanke <[email protected]>2026-07-31 18:05:47 +0800
committersakumisu <[email protected]>2026-07-31 18:16:23 +0800
commit487d0b6499b08f765f829abfd08c49dbc07e9d2c (patch)
tree8c74bfc85935a1dec3dcd3f24e17d8883e543c36
parentaf3a981a7a0be2d63b26e1db2d2ca9a437f9f679 (diff)
fix(idf): support legacy FatFS VFS registration API
-rw-r--r--platform/idf/usbh_fatfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/idf/usbh_fatfs.c b/platform/idf/usbh_fatfs.c
index fef0798f..ca2713ae 100644
--- a/platform/idf/usbh_fatfs.c
+++ b/platform/idf/usbh_fatfs.c
@@ -9,6 +9,7 @@
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
+#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_check.h"
#include "diskio_impl.h"
@@ -215,12 +216,16 @@ esp_err_t msc_host_vfs_register(struct usbh_msc *msc_class,
strcpy(vfs->base_path, base_path);
vfs->pdrv = pdrv;
+#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(6, 0, 0)
esp_vfs_fat_conf_t conf = {
.base_path = base_path,
.fat_drive = drive,
.max_files = mount_config->max_files,
};
ret = esp_vfs_fat_register(&conf, &fs);
+#else
+ ret = esp_vfs_fat_register(base_path, drive, mount_config->max_files, &fs);
+#endif
ESP_GOTO_ON_ERROR(ret, fail, TAG, "Failed to register filesystem, error=%s", esp_err_to_name(ret));
vfs->fs = fs;