Skip to content

Commit

Permalink
Minor performance improvements for ESP32
Browse files Browse the repository at this point in the history
Remove legacy changes for double buffered SPI
Eliminate unecessary ESP32 SPI read/modify write
Eliminate two stage control bit changes (may impact some diplays with
setup/hold  timing and show ESP32 hardware register bug?)
Add single register write for CS and DC command
Make setAddrWindow smarter (as used in previous AVR library)
Improve compatibility with GFX sketches
Re-arrange comments slightly to improve positioning
  • Loading branch information
Bodmer committed Nov 14, 2018
1 parent c7735a8 commit 7a3d6bc
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 158 deletions.
7 changes: 6 additions & 1 deletion Extensions/Smooth_font.cpp
Expand Up @@ -78,6 +78,12 @@ void TFT_eSPI::loadFont(String fontName)

_gFontFilename = "/" + fontName + ".vlw";

// Avoid a crash on the ESP32 if the file does not exist
if (SPIFFS.exists(_gFontFilename) == false) {
Serial.println("Font file " + fontName + " not found!");
return;
}

fontFile = SPIFFS.open( _gFontFilename, "r");

if(!fontFile) return;
Expand Down Expand Up @@ -479,7 +485,6 @@ void TFT_eSPI::drawGlyph(uint16_t code)
void TFT_eSPI::showFont(uint32_t td)
{
if(!fontLoaded) return;
// fontFile = SPIFFS.open( _gFontFilename, "r" );

if(!fontFile)
{
Expand Down
16 changes: 8 additions & 8 deletions TFT_Drivers/ST7735_Defines.h
Expand Up @@ -9,15 +9,15 @@


// Enumerate the different configurations
#define INITR_GREENTAB 0x0
#define INITR_REDTAB 0x1
#define INITR_BLACKTAB 0x2
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
#define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen
#define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITR_GREENTAB 0x0
#define INITR_REDTAB 0x1
#define INITR_BLACKTAB 0x2 // Display with no offsets
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
#define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen
#define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1
#define INITR_REDTAB160x80 0x7 // Added for https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html
#define INITB 0xB
#define INITR_REDTAB160x80 0x7 // Added for https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html
#define INITB 0xB


// Setup the tab color that will be used by the library setRotation() and setup command list
Expand Down

0 comments on commit 7a3d6bc

Please sign in to comment.