From 1a99ce5eb37cef6ee879c57f1027af905b18d4c4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 4 Dec 2021 08:56:42 -0600 Subject: [PATCH] espressif: busio.SPI: Use SPI_DMA_CH_AUTO All 3 micros we care about (S2, S3, C3) state in the documentation that DMA channel can be specified as SPI_DMA_CH_AUTO. Specifying a specific DMA channel explicitly doesn't _ever_ work on ESP32-S3, so no SPI bus could be used. Testing performed: On the ESP32-S3-DevKitC, used neopixel_spi to turn the onboard neopixel red, green, and blue --- ports/espressif/common-hal/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/busio/SPI.c b/ports/espressif/common-hal/busio/SPI.c index fee533e755..09c29084ac 100644 --- a/ports/espressif/common-hal/busio/SPI.c +++ b/ports/espressif/common-hal/busio/SPI.c @@ -93,7 +93,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, mp_raise_ValueError(translate("All SPI peripherals are in use")); } - esp_err_t result = spi_bus_initialize(self->host_id, &bus_config, self->host_id /* dma channel */); + esp_err_t result = spi_bus_initialize(self->host_id, &bus_config, SPI_DMA_CH_AUTO); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) {