Skip to content

Commit

Permalink
Disable SDMMC code when the configuration is off
Browse files Browse the repository at this point in the history
  • Loading branch information
45gfg9 authored and BrianPugh committed Feb 6, 2024
1 parent 2e9cd3b commit b8001cc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/littlefs_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#include <sys/param.h>
#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)
{
Expand Down Expand Up @@ -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
}
}
#endif

#endif

0 comments on commit b8001cc

Please sign in to comment.