diff --git a/Processors/TFT_eSPI_ESP32.h b/Processors/TFT_eSPI_ESP32.h index b8751cf..db0b0bc 100644 --- a/Processors/TFT_eSPI_ESP32.h +++ b/Processors/TFT_eSPI_ESP32.h @@ -73,10 +73,10 @@ SPI3_HOST = 2 #endif #ifdef CONFIG_IDF_TARGET_ESP32C3 - #define SPI_PORT 2 //FSPI(ESP32 C3) - #else - #define SPI_PORT 2 //FSPI(ESP32 S2) - #endif + #define SPI_PORT 2 //FSPI(ESP32 C3) + #else + #define SPI_PORT 2 //FSPI(ESP32 S2) + #endif #endif #ifdef RPI_DISPLAY_TYPE @@ -527,10 +527,19 @@ SPI3_HOST = 2 #define tft_Write_32D(C) TFT_WRITE_BITS((uint16_t)((C)<<8 | (C)>>8)<<16 | (uint16_t)((C)<<8 | (C)>>8), 32) //*/ //* Replacement slimmer macros - #define TFT_WRITE_BITS(D, B) *_spi_mosi_dlen = B-1; \ - *_spi_w = D; \ - *_spi_cmd = SPI_USR; \ - while (*_spi_cmd & SPI_USR); + #if CONFIG_IDF_TARGET_ESP32C3 + #define TFT_WRITE_BITS(D, B) *_spi_mosi_dlen = B-1; \ + *_spi_w = D; \ + *_spi_cmd = SPI_UPDATE; \ + while (*_spi_cmd & SPI_UPDATE); \ + *_spi_cmd = SPI_USR; \ + while (*_spi_cmd & SPI_USR); + #else + #define TFT_WRITE_BITS(D, B) *_spi_mosi_dlen = B-1; \ + *_spi_w = D; \ + *_spi_cmd = SPI_USR; \ + while (*_spi_cmd & SPI_USR); + #endif // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS(C, 8)