فهرست منبع

example/storage: fix incorrect SDSPI DMA setting on c3

Closes https://github.com/espressif/esp-idf/issues/7389
SalimTerryLi 4 سال پیش
والد
کامیت
c0695e4216
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      examples/storage/sd_card/main/sd_card_example_main.c

+ 7 - 1
examples/storage/sd_card/main/sd_card_example_main.c

@@ -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