examples: sdspi: use default DMA channel

This commit is contained in:
Ivan Grokhotkov 2022-02-08 18:48:55 +01:00
parent 2d54f4584e
commit b76971d353
No known key found for this signature in database
GPG Key ID: 1E050E141B280628

View File

@ -25,14 +25,6 @@ static const char *TAG = "example";
#define PIN_NUM_CLK CONFIG_EXAMPLE_PIN_CLK #define PIN_NUM_CLK CONFIG_EXAMPLE_PIN_CLK
#define PIN_NUM_CS CONFIG_EXAMPLE_PIN_CS #define PIN_NUM_CS CONFIG_EXAMPLE_PIN_CS
#if CONFIG_IDF_TARGET_ESP32S2
#define SPI_DMA_CHAN host.slot
#elif CONFIG_IDF_TARGET_ESP32C3
#define SPI_DMA_CHAN SPI_DMA_CH_AUTO
#else
#define SPI_DMA_CHAN 1
#endif
void app_main(void) void app_main(void)
{ {
@ -69,7 +61,7 @@ void app_main(void)
.quadhd_io_num = -1, .quadhd_io_num = -1,
.max_transfer_sz = 4000, .max_transfer_sz = 4000,
}; };
ret = spi_bus_initialize(host.slot, &bus_cfg, SPI_DMA_CHAN); ret = spi_bus_initialize(host.slot, &bus_cfg, SDSPI_DEFAULT_DMA);
if (ret != ESP_OK) { if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to initialize bus."); ESP_LOGE(TAG, "Failed to initialize bus.");
return; return;