mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-07-30 02:37:33 +02:00
Fix #2103 and update for latest ESP8266 board package
Fix H and V gradient use in sprite New ESP8266 board package uses RDUINO_ARCH_ESP8266 old package defined ESP8266
This commit is contained in:
20
TFT_eSPI.cpp
20
TFT_eSPI.cpp
@ -23,7 +23,7 @@
|
||||
#else
|
||||
#include "Processors/TFT_eSPI_ESP32.c"
|
||||
#endif
|
||||
#elif defined (ESP8266)
|
||||
#elif defined (ARDUINO_ARCH_ESP8266)
|
||||
#include "Processors/TFT_eSPI_ESP8266.c"
|
||||
#elif defined (STM32) // (_VARIANT_ARDUINO_STM32_) stm32_def.h
|
||||
#include "Processors/TFT_eSPI_STM32.c"
|
||||
@ -624,7 +624,7 @@ void TFT_eSPI::init(uint8_t tc)
|
||||
sclkpinmask = (uint32_t) digitalPinToBitMask(TFT_SCLK);
|
||||
#endif
|
||||
|
||||
#if defined (TFT_SPI_OVERLAP) && defined (ESP8266)
|
||||
#if defined (TFT_SPI_OVERLAP) && defined (ARDUINO_ARCH_ESP8266)
|
||||
// Overlap mode SD0=MISO, SD1=MOSI, CLK=SCLK must use D3 as CS
|
||||
// pins(int8_t sck, int8_t miso, int8_t mosi, int8_t ss);
|
||||
//spi.pins( 6, 7, 8, 0);
|
||||
@ -653,7 +653,7 @@ void TFT_eSPI::init(uint8_t tc)
|
||||
// Set to output once again in case MISO is used for CS
|
||||
pinMode(TFT_CS, OUTPUT);
|
||||
digitalWrite(TFT_CS, HIGH); // Chip select high (inactive)
|
||||
#elif defined (ESP8266) && !defined (TFT_PARALLEL_8_BIT) && !defined (RP2040_PIO_SPI)
|
||||
#elif defined (ARDUINO_ARCH_ESP8266) && !defined (TFT_PARALLEL_8_BIT) && !defined (RP2040_PIO_SPI)
|
||||
spi.setHwCs(1); // Use hardware SS toggling
|
||||
#endif
|
||||
|
||||
@ -4112,21 +4112,19 @@ void TFT_eSPI::fillRectVGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin
|
||||
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
|
||||
begin_tft_write();
|
||||
|
||||
setWindow(x, y, x + w - 1, y + h - 1);
|
||||
begin_nin_write();
|
||||
|
||||
float delta = -255.0/h;
|
||||
float alpha = 255.0;
|
||||
uint32_t color = color1;
|
||||
|
||||
while (h--) {
|
||||
pushBlock(color, w);
|
||||
drawFastHLine(x, y++, w, color);
|
||||
alpha += delta;
|
||||
color = alphaBlend((uint8_t)alpha, color1, color2);
|
||||
}
|
||||
|
||||
end_tft_write();
|
||||
end_nin_write();
|
||||
}
|
||||
|
||||
|
||||
@ -4152,7 +4150,7 @@ void TFT_eSPI::fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin
|
||||
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
|
||||
begin_tft_write();
|
||||
begin_nin_write();
|
||||
|
||||
float delta = -255.0/w;
|
||||
float alpha = 255.0;
|
||||
@ -4164,7 +4162,7 @@ void TFT_eSPI::fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin
|
||||
color = alphaBlend((uint8_t)alpha, color1, color2);
|
||||
}
|
||||
|
||||
end_tft_write();
|
||||
end_nin_write();
|
||||
}
|
||||
|
||||
|
||||
@ -4452,7 +4450,7 @@ uint32_t TFT_eSPI::alphaBlend24(uint8_t alpha, uint32_t fgc, uint32_t bgc, uint8
|
||||
** Description: draw characters piped through serial stream
|
||||
***************************************************************************************/
|
||||
/* // Not all processors support buffered write
|
||||
#ifndef ESP8266 // Avoid ESP8266 board package bug
|
||||
#ifndef ARDUINO_ARCH_ESP8266 // Avoid ESP8266 board package bug
|
||||
size_t TFT_eSPI::write(const uint8_t *buf, size_t len)
|
||||
{
|
||||
inTransaction = true;
|
||||
|
15
TFT_eSPI.h
15
TFT_eSPI.h
@ -16,7 +16,7 @@
|
||||
#ifndef _TFT_eSPIH_
|
||||
#define _TFT_eSPIH_
|
||||
|
||||
#define TFT_ESPI_VERSION "2.4.78"
|
||||
#define TFT_ESPI_VERSION "2.4.79"
|
||||
|
||||
// Bit level feature flags
|
||||
// Bit 0 set: viewport capability
|
||||
@ -40,6 +40,14 @@
|
||||
#include "TFT_config.h"
|
||||
#endif
|
||||
|
||||
// New ESP8266 board package uses ARDUINO_ARCH_ESP8266
|
||||
// old package defined ESP8266
|
||||
#if defined (ESP8266)
|
||||
#ifndef ARDUINO_ARCH_ESP8266
|
||||
#define ARDUINO_ARCH_ESP8266
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// The following lines allow the user setup to be included in the sketch folder, see
|
||||
// "Sketch_with_tft_setup" generic example.
|
||||
#if !defined __has_include
|
||||
@ -75,7 +83,7 @@
|
||||
})
|
||||
#elif defined(__AVR__)
|
||||
#include <avr/pgmspace.h>
|
||||
#elif defined(ESP8266) || defined(ESP32)
|
||||
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ESP32)
|
||||
#include <pgmspace.h>
|
||||
#else
|
||||
#define PROGMEM
|
||||
@ -88,7 +96,7 @@
|
||||
#include "Processors/TFT_eSPI_ESP32_C3.h"
|
||||
#elif defined (ESP32)
|
||||
#include "Processors/TFT_eSPI_ESP32.h"
|
||||
#elif defined (ESP8266)
|
||||
#elif defined (ARDUINO_ARCH_ESP8266)
|
||||
#include "Processors/TFT_eSPI_ESP8266.h"
|
||||
#elif defined (STM32)
|
||||
#include "Processors/TFT_eSPI_STM32.h"
|
||||
@ -678,6 +686,7 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac
|
||||
|
||||
|
||||
// DMA support functions - these are currently just for SPI writes when using the ESP32 or STM32 processors
|
||||
// DMA works also on RP2040 and PIO SPI, 8 bit parallel and 16 bit parallel
|
||||
// Bear in mind DMA will only be of benefit in particular circumstances and can be tricky
|
||||
// to manage by noobs. The functions have however been designed to be noob friendly and
|
||||
// avoid a few DMA behaviour "gotchas".
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TFT_eSPI",
|
||||
"version": "2.4.78",
|
||||
"version": "2.4.79",
|
||||
"keywords": "Arduino, tft, display, ttgo, LilyPi, WT32-SC01, ePaper, display, Pico, RP2040 Nano Connect, RP2040, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9481, ILI9486, ILI9488, ST7789, ST7796, RM68140, SSD1351, SSD1963, ILI9225, HX8357D, GC9A01, R61581",
|
||||
"description": "A TFT and ePaper (SPI or parallel interface) graphics library with optimisation for Raspberry Pi Pico, RP2040, ESP8266, ESP32 and STM32 processors",
|
||||
"repository":
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=TFT_eSPI
|
||||
version=2.4.78
|
||||
version=2.4.79
|
||||
author=Bodmer
|
||||
maintainer=Bodmer
|
||||
sentence=TFT graphics library for Arduino processors with performance optimisation for RP2040, STM32, ESP8266 and ESP32
|
||||
|
Reference in New Issue
Block a user