diff --git a/TFT_Drivers/ST7735_Init.h b/TFT_Drivers/ST7735_Init.h index 41a9c9d..0df152c 100644 --- a/TFT_Drivers/ST7735_Init.h +++ b/TFT_Drivers/ST7735_Init.h @@ -140,8 +140,6 @@ ST7735_DISPON , TFT_INIT_DELAY, // 4: Main screen turn on, no args w/delay 100 }; // 100 ms delay - tabcolor = TAB_COLOUR; - if (tabcolor == INITB) { commandList(Bcmd); diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index b5e2164..c13b596 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -209,9 +209,9 @@ TFT_eSPI::TFT_eSPI(int16_t w, int16_t h) ** Function name: begin ** Description: Included for backwards compatibility ***************************************************************************************/ -void TFT_eSPI::begin(void) +void TFT_eSPI::begin(uint8_t tc) { - init(); + init(tc); } @@ -219,7 +219,7 @@ void TFT_eSPI::begin(void) ** Function name: init ** Description: Reset, then initialise the TFT display registers ***************************************************************************************/ -void TFT_eSPI::init(void) +void TFT_eSPI::init(uint8_t tc) { #if !defined (ESP32) #ifdef TFT_CS @@ -307,6 +307,7 @@ void TFT_eSPI::init(void) #include "TFT_Drivers/ILI9341_Init.h" #elif defined (ST7735_DRIVER) + tabcolor = tc; #include "TFT_Drivers/ST7735_Init.h" #elif defined (ILI9163_DRIVER) @@ -318,6 +319,9 @@ void TFT_eSPI::init(void) #elif defined (RPI_ILI9486_DRIVER) #include "TFT_Drivers/RPI_ILI9486_Init.h" +#elif defined (ILI9486_DRIVER) + #include "TFT_Drivers/ILI9486_Init.h" + #elif defined (ILI9481_DRIVER) #include "TFT_Drivers/ILI9481_Init.h" @@ -359,6 +363,9 @@ void TFT_eSPI::setRotation(uint8_t m) #elif defined (RPI_ILI9486_DRIVER) #include "TFT_Drivers/RPI_ILI9486_Rotation.h" +#elif defined (ILI9486_DRIVER) + #include "TFT_Drivers/ILI9486_Rotation.h" + #elif defined (ILI9481_DRIVER) #include "TFT_Drivers/ILI9481_Rotation.h" diff --git a/TFT_eSPI.h b/TFT_eSPI.h index e17774f..86e7cf8 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -21,6 +21,10 @@ // available and the pins to be used #include +#ifndef TAB_COLOUR + TAB_COLOUR 0 +#endif + // If the frequency is not defined, set a default #ifndef SPI_FREQUENCY #define SPI_FREQUENCY 20000000 @@ -491,7 +495,7 @@ class TFT_eSPI : public Print { TFT_eSPI(int16_t _W = TFT_WIDTH, int16_t _H = TFT_HEIGHT); - void init(void), begin(void); // Same - begin included for backwards compatibility + void init(uint8_t tc = TAB_COLOUR), begin(uint8_t tc = TAB_COLOUR); // Same - begin included for backwards compatibility // These are virtual so the TFT_eSprite class can override them with sprite specific functions virtual void drawPixel(uint32_t x, uint32_t y, uint32_t color), diff --git a/examples/Generic/TFT_SPIFFS_BMP/TFT_SPIFFS_BMP.ino b/examples/Generic/TFT_SPIFFS_BMP/TFT_SPIFFS_BMP.ino index a40ce4c..df43a4d 100644 --- a/examples/Generic/TFT_SPIFFS_BMP/TFT_SPIFFS_BMP.ino +++ b/examples/Generic/TFT_SPIFFS_BMP/TFT_SPIFFS_BMP.ino @@ -8,7 +8,7 @@ // Data folder, press Ctrl+K to see this folder. Use the IDE "Tools" menu // option to upload the sketches data folder to the SPIFFS -// This sketch ahs been tested on the ESP32 and ESP8266 +// This sketch has been tested on the ESP32 and ESP8266 //---------------------------------------------------------------------------------------------------- diff --git a/examples/Generic/drawXBitmap/drawXBitmap.ino b/examples/Generic/drawXBitmap/drawXBitmap.ino index 8678c31..d43138e 100644 --- a/examples/Generic/drawXBitmap/drawXBitmap.ino +++ b/examples/Generic/drawXBitmap/drawXBitmap.ino @@ -7,7 +7,7 @@ // This example is part of the TFT_eSPI library: // https://github.com/Bodmer/TFT_eSPI -// Created by Bodmer 23/14/18 +// Created by Bodmer 23/04/18 #include "xbm.h" // Sketch tab header for xbm images diff --git a/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino b/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino index f326cad..45d48bf 100644 --- a/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino +++ b/examples/Test and diagnostics/Read_User_Setup/Read_User_Setup.ino @@ -8,7 +8,7 @@ verify the correct settings are being picked up by the compiler. If support is needed the output can be cut and pasted into an Arduino Forum post and - already inlcudes the formatting [code]...[/code] markups. + already includes the formatting [code]...[/code] markups. Written by Bodmer 9/4/18 */