Couple small fixes in preparation for submission upstream
This commit is contained in:
parent
b33b88c648
commit
da867d585c
|
|
@ -20,6 +20,9 @@
|
||||||
*/
|
*/
|
||||||
writecommand(ST7787_COLMOD);
|
writecommand(ST7787_COLMOD);
|
||||||
writedata((13 << 4) | 5);
|
writedata((13 << 4) | 5);
|
||||||
|
/* Initialise to Rotation 0. */
|
||||||
|
writecommand(TFT_MADCTL);
|
||||||
|
writedata(TFT_MAD_ML | TFT_MAD_RGB);
|
||||||
/* Disable external vsync. */
|
/* Disable external vsync. */
|
||||||
writecommand(ST7787_VSYNCOUT);
|
writecommand(ST7787_VSYNCOUT);
|
||||||
/* Turn on the display */
|
/* Turn on the display */
|
||||||
|
|
|
||||||
10
TFT_eSPI.cpp
10
TFT_eSPI.cpp
|
|
@ -80,10 +80,10 @@ inline void TFT_eSPI::spi_end(void){
|
||||||
if(!inTransaction) {
|
if(!inTransaction) {
|
||||||
if (!locked) {
|
if (!locked) {
|
||||||
locked = true;
|
locked = true;
|
||||||
SPI.endTransaction();
|
#ifdef IFACE_3WIRE_ESP8266
|
||||||
#ifdef IFACE_3WIRE_ESP8266
|
|
||||||
SPI1U &= ~(uint32_t)(SPIUWRBYO|SPIURDBYO);
|
SPI1U &= ~(uint32_t)(SPIUWRBYO|SPIURDBYO);
|
||||||
#endif
|
#endif
|
||||||
|
SPI.endTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -208,7 +208,6 @@ void TFT_eSPI::init(void)
|
||||||
SPI.begin(); // This will set HMISO to input
|
SPI.begin(); // This will set HMISO to input
|
||||||
#else
|
#else
|
||||||
#if defined (TFT_MOSI) && !defined (TFT_SPI_OVERLAP)
|
#if defined (TFT_MOSI) && !defined (TFT_SPI_OVERLAP)
|
||||||
// ToDo: handle 3-wire interface on ESP32.
|
|
||||||
SPI.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, -1);
|
SPI.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, -1);
|
||||||
#else
|
#else
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
|
|
@ -224,10 +223,11 @@ void TFT_eSPI::init(void)
|
||||||
SPI.setBitOrder(MSBFIRST);
|
SPI.setBitOrder(MSBFIRST);
|
||||||
SPI.setDataMode(SPI_MODE0);
|
SPI.setDataMode(SPI_MODE0);
|
||||||
SPI.setFrequency(SPI_FREQUENCY);
|
SPI.setFrequency(SPI_FREQUENCY);
|
||||||
|
|
||||||
#ifdef IFACE_3WIRE_ESP8266
|
#ifdef IFACE_3WIRE_ESP8266
|
||||||
SPI1U |= (uint32_t)(SPIUWRBYO|SPIURDBYO);
|
SPI1U |= (uint32_t)(SPIUWRBYO|SPIURDBYO);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ESP32 // Unlock the SPI hal mutex and set the lock management flags
|
#ifdef ESP32 // Unlock the SPI hal mutex and set the lock management flags
|
||||||
SPI.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0));
|
SPI.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0));
|
||||||
inTransaction = true; // Flag to stop intermediate spi_end calls
|
inTransaction = true; // Flag to stop intermediate spi_end calls
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue