ESP32 Change use of SPI transactions
Using the SUPPORT_TRANSACTIONS define to initialize SPI on ESP32 with or without transaction support.
This commit is contained in:
parent
80b5d91ba4
commit
9cad339bc7
13
TFT_eSPI.cpp
13
TFT_eSPI.cpp
|
|
@ -192,9 +192,16 @@ void TFT_eSPI::init(void)
|
|||
SPI.setFrequency(SPI_FREQUENCY);
|
||||
|
||||
#ifdef ESP32 // Unlock the SPI hal mutex and set the lock management flags
|
||||
SPI.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0));
|
||||
inTransaction = true; // Flag to stop intermediate spi_end calls
|
||||
locked = false; // Flag to stop repeat beginTransaction calls
|
||||
#ifdef SUPPORT_TRANSACTIONS
|
||||
SPI.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0));
|
||||
inTransaction = true; // Flag to stop intermediate spi_end calls
|
||||
locked = false; // Flag to stop repeat beginTransaction calls
|
||||
#else
|
||||
SPI.begin(TFT_SCLK,TFT_MISO,TFT_MOSI);
|
||||
SPI.setFrequency(SPI_FREQUENCY);
|
||||
SPI.setBitOrder(MSBFIRST);
|
||||
SPI.setDataMode(SPI_MODE0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue