diff --git a/Processors/TFT_eSPI_ESP32.c b/Processors/TFT_eSPI_ESP32.c index 2c3ed64..30d3d51 100644 --- a/Processors/TFT_eSPI_ESP32.c +++ b/Processors/TFT_eSPI_ESP32.c @@ -705,7 +705,7 @@ bool TFT_eSPI::initDMA(void) void TFT_eSPI::deInitDMA(void) { if (!DMA_Enabled) return; - + spi_bus_remove_device(dmaHAL); spi_bus_free(spi_host); DMA_Enabled = false; } diff --git a/Processors/TFT_eSPI_ESP32.h b/Processors/TFT_eSPI_ESP32.h index 23477c7..f5fe7fd 100644 --- a/Processors/TFT_eSPI_ESP32.h +++ b/Processors/TFT_eSPI_ESP32.h @@ -166,12 +166,64 @@ #endif //////////////////////////////////////////////////////////////////////////////////////// -// Make sure TFT_MISO is defined if not used to avoid an error message +// Make sure SPI default pins are assigned if not specified by user or set to -1 //////////////////////////////////////////////////////////////////////////////////////// #if !defined (TFT_PARALLEL_8_BIT) - #ifndef TFT_MISO - #define TFT_MISO -1 + + #ifdef USE_HSPI_PORT + + #ifndef TFT_MISO + #define TFT_MISO 12 + #endif + #if (TFT_MISO == -1) + #undef TFT_MISO + #define TFT_MISO 12 + #endif + + #ifndef TFT_MOSI + #define TFT_MOSI 13 + #endif + #if (TFT_MOSI == -1) + #undef TFT_MOSI + #define TFT_MOSI 13 + #endif + + #ifndef TFT_SCLK 14 + #define TFT_SCLK + #endif + #if (TFT_SCLK == -1) + #undef TFT_SCLK + #define TFT_SCLK 14 + #endif + + #else // VSPI port + + #ifndef TFT_MISO + #define TFT_MISO 19 + #endif + #if (TFT_MISO == -1) + #undef TFT_MISO + #define TFT_MISO 19 + #endif + + #ifndef TFT_MOSI + #define TFT_MOSI 23 + #endif + #if (TFT_MOSI == -1) + #undef TFT_MOSI + #define TFT_MOSI 23 + #endif + + #ifndef TFT_SCLK + #define TFT_SCLK 18 + #endif + #if (TFT_SCLK == -1) + #undef TFT_SCLK + #define TFT_SCLK 18 + #endif + #endif + #endif //////////////////////////////////////////////////////////////////////////////////////// diff --git a/TFT_eSPI.h b/TFT_eSPI.h index 5558692..4ab6ce3 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -16,7 +16,7 @@ #ifndef _TFT_eSPIH_ #define _TFT_eSPIH_ -#define TFT_ESPI_VERSION "2.2.7" +#define TFT_ESPI_VERSION "2.2.8" /*************************************************************************************** ** Section 1: Load required header files diff --git a/library.json b/library.json index cbfea7c..70efa62 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "2.2.7", + "version": "2.2.8", "keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140", "description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32", "repository": diff --git a/library.properties b/library.properties index 069b77d..a3b3ab4 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=2.2.7 +version=2.2.8 author=Bodmer maintainer=Bodmer sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32