example/storage: fix incorrect SDSPI DMA setting on c3

Closes https://github.com/espressif/esp-idf/issues/7389
This commit is contained in:
SalimTerryLi 2021-10-06 14:22:03 +08:00
parent 86b7acc932
commit c0695e4216
No known key found for this signature in database
GPG Key ID: F05CCEF2191AF770

View File

@ -33,12 +33,18 @@ static const char *TAG = "example";
// #define USE_SPI_MODE
// ESP32-S2 and ESP32-C3 doesn't have an SD Host peripheral, always use SPI:
#if CONFIG_IDF_TARGET_ESP32S2 ||CONFIG_IDF_TARGET_ESP32C3
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
#ifndef USE_SPI_MODE
#define USE_SPI_MODE
#endif // USE_SPI_MODE
// on ESP32-S2, DMA channel must be the same as host id
#if CONFIG_IDF_TARGET_ESP32S2
#define SPI_DMA_CHAN host.slot
#elif CONFIG_IDF_TARGET_ESP32C3
#define SPI_DMA_CHAN SPI_DMA_CH_AUTO
#endif //CONFIG_IDF_TARGET_ESP32S2
#endif //CONFIG_IDF_TARGET_ESP32S2
// DMA channel to be used by the SPI peripheral