hideakitai / ESP32DMASPI

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

ESP32DMASPISlave.h:50:5: sorry, unimplemented: non-trivial designated initializers not supported #19

Closed sonalsustainable closed 2 years ago

sonalsustainable commented 2 years ago

Hello Before I was using your code without any problem but with you latest code I am getting this errors. Thank you for the help

/Arduino/libraries/ESP32DMASPI-master/ESP32DMASPISlave.h:50:5: sorry, unimplemented: non-trivial designated initializers not supported }; ^ /home/peri/Arduino/libraries/ESP32DMASPI-master/ESP32DMASPISlave.h:50:5: sorry, unimplemented: non-trivial designated initializers not supported /home/peri/Arduino/libraries/ESP32DMASPI-master/ESP32DMASPISlave.h:53:19: error: 'SPI_DMA_CH_AUTO' was not declared in this scope int dma_chan {SPI_DMA_CH_AUTO}; // must be 1, 2 or SPI_DMA_CH_AUTO

JBSchueler commented 2 years ago

Same issue reported 3 weeks ago. Look at #13 how to solve this issue

jlarnal commented 2 years ago

"Designated initializers" are a legacy from C and are deemed invalid in C++11. They came back in C++20 under the guise of "aggregate initializers", but the fields appearing between the braces must be in the same order as the one they are declared in.

My two cents : do NOT use these kind of initialization patterns, for portability's sake. 😕

hideakitai commented 2 years ago

Currently, I don't plan to change it because this is used only with esp32. I'm waiting for the pull request :)