From b8001cc16f5ecce866ca5335e36bf9112168ae6d Mon Sep 17 00:00:00 2001 From: 45gfg9 <45gfg9@45gfg9.net> Date: Wed, 7 Feb 2024 05:32:09 +0800 Subject: [PATCH] Disable SDMMC code when the configuration is off --- src/littlefs_sdmmc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/littlefs_sdmmc.c b/src/littlefs_sdmmc.c index 88732fa..78ad59b 100644 --- a/src/littlefs_sdmmc.c +++ b/src/littlefs_sdmmc.c @@ -8,9 +8,11 @@ #include #include "littlefs_api.h" -#if CONFIG_LITTLEFS_SDMMC_SUPPORT && ESP_IDF_VERSION_MAJOR < 5 +#if CONFIG_LITTLEFS_SDMMC_SUPPORT + +#if ESP_IDF_VERSION_MAJOR < 5 #error "SDMMC feature is only supported in ESP-IDF v5+, see: https://github.com/joltwallet/esp_littlefs/pull/170#issuecomment-1882484668" -#endif +#else int littlefs_sdmmc_read(const struct lfs_config *c, lfs_block_t block, lfs_off_t off, void *buffer, lfs_size_t size) { @@ -55,4 +57,7 @@ int littlefs_sdmmc_erase(const struct lfs_config *c, lfs_block_t block) int littlefs_sdmmc_sync(const struct lfs_config *c) { return LFS_ERR_OK; // Doesn't require & doesn't support sync -} \ No newline at end of file +} +#endif + +#endif