mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'refactor/fatfs_vfs_change_esp_vfs_fat_register_prototype_v6.0' into 'release/v6.0'
refactor(fatfs): Update esp_vfs_fat_register function prototype (v6.0) See merge request espressif/esp-idf!45980
This commit is contained in:
@@ -66,7 +66,7 @@ typedef struct {
|
||||
* - ESP_ERR_INVALID_STATE if esp_vfs_fat_register was already called
|
||||
* - ESP_ERR_NO_MEM if not enough memory or too many VFSes already registered
|
||||
*/
|
||||
esp_err_t esp_vfs_fat_register_cfg(const esp_vfs_fat_conf_t* conf, FATFS** out_fs);
|
||||
esp_err_t esp_vfs_fat_register(const esp_vfs_fat_conf_t* conf, FATFS** out_fs);
|
||||
|
||||
/**
|
||||
* @brief Un-register FATFS from VFS
|
||||
@@ -446,11 +446,11 @@ esp_err_t esp_vfs_fat_test_contiguous_file(const char* base_path, const char* fu
|
||||
|
||||
/** @cond */
|
||||
/**
|
||||
* @deprecated Please use `esp_vfs_fat_register_cfg` instead
|
||||
* @deprecated Please use `esp_vfs_fat_register` instead
|
||||
*/
|
||||
esp_err_t esp_vfs_fat_register(const char* base_path, const char* fat_drive,
|
||||
size_t max_files, FATFS** out_fs);
|
||||
esp_err_t esp_vfs_fat_register_cfg(const esp_vfs_fat_conf_t* conf, FATFS** out_fs);
|
||||
|
||||
#ifndef CONFIG_IDF_TARGET_LINUX
|
||||
/**
|
||||
* @deprecated Please use `esp_vfs_fat_spiflash_mount_rw_wl` instead
|
||||
*/
|
||||
@@ -479,6 +479,7 @@ esp_err_t esp_vfs_fat_rawflash_mount(const char* base_path,
|
||||
*/
|
||||
esp_err_t esp_vfs_fat_rawflash_unmount(const char* base_path, const char* partition_label)
|
||||
__attribute__((deprecated("esp_vfs_fat_rawflash_unmount is deprecated, please use esp_vfs_fat_spiflash_unmount_ro instead")));
|
||||
#endif
|
||||
/** @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -138,16 +138,6 @@ static size_t find_unused_context_index(void)
|
||||
return FF_VOLUMES;
|
||||
}
|
||||
|
||||
esp_err_t esp_vfs_fat_register(const char* base_path, const char* fat_drive, size_t max_files, FATFS** out_fs)
|
||||
{
|
||||
esp_vfs_fat_conf_t conf = {
|
||||
.base_path = base_path,
|
||||
.fat_drive = fat_drive,
|
||||
.max_files = max_files,
|
||||
};
|
||||
return esp_vfs_fat_register_cfg(&conf, out_fs);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_VFS_SUPPORT_DIR
|
||||
static const esp_vfs_dir_ops_t s_vfs_fat_dir = {
|
||||
.stat_p = &vfs_fat_stat,
|
||||
@@ -185,7 +175,7 @@ static const esp_vfs_fs_ops_t s_vfs_fat = {
|
||||
#endif // CONFIG_VFS_SUPPORT_DIR
|
||||
};
|
||||
|
||||
esp_err_t esp_vfs_fat_register_cfg(const esp_vfs_fat_conf_t* conf, FATFS** out_fs)
|
||||
esp_err_t esp_vfs_fat_register(const esp_vfs_fat_conf_t* conf, FATFS** out_fs)
|
||||
{
|
||||
size_t ctx = find_context_index_by_path(conf->base_path);
|
||||
if (ctx < FF_VOLUMES) {
|
||||
@@ -236,6 +226,8 @@ esp_err_t esp_vfs_fat_register_cfg(const esp_vfs_fat_conf_t* conf, FATFS** out_f
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_vfs_fat_register_cfg(const esp_vfs_fat_conf_t* conf, FATFS** out_fs) __attribute__((alias("esp_vfs_fat_register")));
|
||||
|
||||
esp_err_t esp_vfs_fat_unregister_path(const char* base_path)
|
||||
{
|
||||
size_t ctx = find_context_index_by_path(base_path);
|
||||
|
||||
@@ -155,12 +155,12 @@ static esp_err_t esp_vfs_fat_mount_internal(const esp_vfs_fat_mount_config_t *mo
|
||||
.fat_drive = drv,
|
||||
.max_files = mount_config->max_files,
|
||||
};
|
||||
err = esp_vfs_fat_register_cfg(&conf, &fs);
|
||||
err = esp_vfs_fat_register(&conf, &fs);
|
||||
*out_fs = fs;
|
||||
if (err == ESP_ERR_INVALID_STATE) {
|
||||
// it's okay, already registered with VFS
|
||||
} 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,11 +177,11 @@ esp_err_t esp_vfs_fat_spiflash_mount_rw_wl(const char* base_path,
|
||||
.fat_drive = drv,
|
||||
.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) {
|
||||
// it's okay, already registered with VFS
|
||||
} 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;
|
||||
}
|
||||
|
||||
@@ -367,11 +367,11 @@ esp_err_t esp_vfs_fat_spiflash_mount_ro(const char* base_path,
|
||||
.fat_drive = drv,
|
||||
.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) {
|
||||
// it's okay, already registered with VFS
|
||||
} 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ Storage
|
||||
|
||||
:link_to_translation:`zh_CN:[中文]`
|
||||
|
||||
Removed VFS SDMMC Deprecated API
|
||||
--------------------------------
|
||||
Breaking Changes
|
||||
----------------
|
||||
|
||||
Deprecated ``esp_vfs_fat_sdmmc_unmount`` function is now removed. Please use ``esp_vfs_fat_sdcard_unmount`` instead.
|
||||
|
||||
Function prototype for ``esp_vfs_fat_register`` has been changed to match ``esp_vfs_fat_register_cfg`` function. ``esp_vfs_fat_register_cfg`` is now deprecated.
|
||||
|
||||
|
||||
VFS
|
||||
---
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
|
||||
:link_to_translation:`en:[English]`
|
||||
|
||||
移除已弃用的 VFS SDMMC API
|
||||
---------------------------
|
||||
重大变更
|
||||
--------
|
||||
|
||||
``esp_vfs_fat_sdmmc_unmount`` 函数已弃用且被移除,请使用 ``esp_vfs_fat_sdcard_unmount`` 代替。
|
||||
已被弃用的 API ``esp_vfs_fat_sdmmc_unmount`` 现已移除,请使用 ``esp_vfs_fat_sdcard_unmount`` 代替。
|
||||
|
||||
``esp_vfs_fat_register`` 的函数原型已修改为与 ``esp_vfs_fat_register_cfg`` 函数保持一致。``esp_vfs_fat_register_cfg`` 现已弃用。
|
||||
|
||||
|
||||
VFS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb:
|
||||
version: "^2.0.0"
|
||||
version: "^2.0.1~1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb:
|
||||
version: "^2.0.0"
|
||||
version: "^2.0.1~1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb:
|
||||
version: "^2.0.0"
|
||||
version: "^2.0.1~1"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb:
|
||||
version: "^2.0.0"
|
||||
version: "^2.0.1~1"
|
||||
|
||||
@@ -273,7 +273,12 @@ esp_err_t msc_host_vfs_register(struct usbh_msc *msc_class,
|
||||
strcpy(vfs->base_path, base_path);
|
||||
vfs->pdrv = pdrv;
|
||||
|
||||
ret = esp_vfs_fat_register(base_path, drive, mount_config->max_files, &fs);
|
||||
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);
|
||||
ESP_GOTO_ON_ERROR(ret, fail, TAG, "Failed to register filesystem, error=%s", esp_err_to_name(ret));
|
||||
vfs->fs = fs;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
idf: ">=4.4"
|
||||
usb_host_msc: "^1.1.1"
|
||||
usb_host_msc: "^1.1.4"
|
||||
|
||||
Reference in New Issue
Block a user