From 6b8e4212be16514f09f7da6bde7c72c388fd232b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 8 Feb 2022 18:38:06 +0100 Subject: [PATCH] driver: sdspi: set default DMA channel compatible with S3, C3 or later --- components/driver/include/driver/sdspi_host.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/driver/include/driver/sdspi_host.h b/components/driver/include/driver/sdspi_host.h index abb690c39b..a5d942e9d8 100644 --- a/components/driver/include/driver/sdspi_host.h +++ b/components/driver/include/driver/sdspi_host.h @@ -22,8 +22,10 @@ typedef int sdspi_dev_handle_t; #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 #define SDSPI_DEFAULT_HOST HSPI_HOST +#define SDSPI_DEFAULT_DMA SDSPI_DEFAULT_HOST #else #define SDSPI_DEFAULT_HOST SPI2_HOST +#define SDSPI_DEFAULT_DMA SPI_DMA_CH_AUTO #endif /** @@ -216,7 +218,7 @@ typedef struct { .gpio_miso = GPIO_NUM_2, \ .gpio_mosi = GPIO_NUM_15, \ .gpio_sck = GPIO_NUM_14, \ - .dma_channel = 1, \ + .dma_channel = SDSPI_DEFAULT_DMA, \ } /**