hideakitai / ESP32DMASPI

SPI library for ESP32 which use DMA buffer to send/receive transactions
MIT License
166 stars 36 forks source link

non-trivial-designated-initializers-not-supported #22

Closed DPWilde closed 11 months ago

DPWilde commented 2 years ago

Above error when compiling Master_Slave task example in Arduino IDE 2.0.0-rc5 (also in 1.8.19). This can be resolved by changing the initialisation of bus_cfg as below in both ESP32DMASPISlave.h and ESP32DMASPIMaster.h :

spi_bus_config_t bus_cfg {
    .mosi_io_num = 13,        // HSPI
    .miso_io_num = 12,        // HSPI
    .sclk_io_num = 14,        // HSPI
    .quadwp_io_num = -1,      // not used
    .quadhd_io_num = -1,      // not used
    .max_transfer_sz = 4092,  // default: 4092 if DMA enabled, SOC_SPI_MAXIMUM_BUFFER_SIZE if DMA disabled
    .flags = SPICOMMON_BUSFLAG_SLAVE,
    .intr_flags = 0
};

In addition another error is that SPI_DMA_CHA_AUTO is no longer valid in the latest ESP32 core ( I have version 1.06). I resolved by initialising to DMA channel 1 however it would be better to check if free first.

hideakitai commented 2 years ago

Please see #13

hideakitai commented 2 years ago

Your esp board firmware version should be >= 2.0.0. Not IDE itself

hideakitai commented 11 months ago

I'm closing this issue because of no activity.