backward compatibility with esp-idf release/v4.2 (<4.3)

This commit is contained in:
hiruna 2023-06-03 23:28:41 +10:00
parent 66cee1b191
commit a76c88fd66

View file

@ -182,7 +182,11 @@ bool lvgl_spi_driver_init(int host,
#if defined (CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
dma_channel = SPI_DMA_CH_AUTO;
#endif
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4,3,0)
esp_err_t ret = spi_bus_initialize(host, &buscfg, dma_channel);
#else
esp_err_t ret = spi_bus_initialize(host, &buscfg, (spi_dma_chan_t)dma_channel);
#endif
assert(ret == ESP_OK);
return ESP_OK != ret;