hideakitai / ESP32DMASPI

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

ESP32DMASPI v0.2.0 : Compile Error ESP32DMASPISlave.h #13

Closed JBSchueler closed 2 years ago

JBSchueler commented 2 years ago

I get a compile error

In file included from C:\projects\Arduino\libraries\ESP32DMASPI\examples\slave_simple_task\slave_simple_task.ino:1:0:
C:\projects\Arduino\libraries\ESP32DMASPI/ESP32DMASPISlave.h:50:5: sorry, unimplemented: non-trivial designated initializers not supported
     };
     ^
C:\projects\Arduino\libraries\ESP32DMASPI/ESP32DMASPISlave.h:50:5: sorry, unimplemented: non-trivial designated initializers not supported
C:\projects\Arduino\libraries\ESP32DMASPI/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
                   ^
C:\projects\Arduino\libraries\ESP32DMASPI/ESP32DMASPISlave.h:53:34: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization
     int dma_chan {SPI_DMA_CH_AUTO};  // must be 1, 2 or SPI_DMA_CH_AUTO
                                  ^
C:\projects\Arduino\libraries\ESP32DMASPI/ESP32DMASPISlave.h: In member function 'void arduino::esp32::spi::dma::Slave::setDMAChannel(uint8_t)':
C:\projects\Arduino\libraries\ESP32DMASPI/ESP32DMASPISlave.h:188:24: error: 'SPI_DMA_CH_AUTO' was not declared in this scope
             dma_chan = SPI_DMA_CH_AUTO;
                        ^
Using library ESP32DMASPI at version 0.2.0 in folder: C:\projects\Arduino\libraries\ESP32DMASPI 
Fasol0 commented 2 years ago

Yes I had the same issues,

you can see that compared to the original file, I added the missing fields .quadwp_io_num, .quadhd_io_num (both can be set to -1 without any effect) and .intr_flags (you can also set it to 0)

JBSchueler commented 2 years ago

@Fasol0 , thanks. I noticed SPI_DMA_CH_AUTOshould have the value 3 by looking at the code https://github.com/hideakitai/ESP32DMASPI/blob/9a77471f992a5573aaff1e2fb566df819637cb88/ESP32DMASPISlave.h#L184 It accepts 3 as well so that must be SPI_DMA_CH_AUTO

Nevertheless, it should be solved. Personally I don't push code which is does not compile.

hideakitai commented 2 years ago

@JBSchueler @Fasol0 Hi, v0.2.0 requires ESP32 version >= 2.0.0 for Arduino IDE, and not supported on PlatformIO now. Added supported version matrix to README

JBSchueler commented 2 years ago

@hideakitai Thanks for the information, I was not aware of that.