Update TFT_eSPI lib,Fix TFT-Shield Wrong size definition

This commit is contained in:
lewishe 2023-08-01 12:11:56 +08:00
commit 73bdb79a3e
40 changed files with 2230 additions and 2847 deletions

View file

@ -4498,8 +4498,8 @@ void TFT_eSPI::drawWedgeLine(float ax, float ay, float bx, float by, float ar, f
int32_t xs = x0;
// Scan bounding box from ys down, calculate pixel intensity from distance to line
for (int32_t yp = ys; yp <= y1; yp++) {
char swin = false; // Flag to start new window area
char endX = false; // Flag to skip pixels
bool swin = true; // Flag to start new window area
bool endX = false; // Flag to skip pixels
ypay = yp - ay;
for (int32_t xp = xs; xp <= x1; xp++) {
if (endX) if (alpha <= LoAlphaTheshold) break; // Skip right side
@ -4520,11 +4520,11 @@ void TFT_eSPI::drawWedgeLine(float ax, float ay, float bx, float by, float ar, f
//Blend color with background and plot
if (bg_color == 0x00FFFFFF) {
bg = readPixel(xp, yp); swin = true;
if(!swin);
}
#ifdef GC9A01_DRIVER
uint16_t pcol = alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg);
drawPixel(xp, yp, pcol);
swin = swin;
#else
if (swin) { setWindow(xp, yp, x1, yp); swin = false; }
pushColor(alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg));
@ -4558,11 +4558,11 @@ void TFT_eSPI::drawWedgeLine(float ax, float ay, float bx, float by, float ar, f
//Blend colour with background and plot
if (bg_color == 0x00FFFFFF) {
bg = readPixel(xp, yp); swin = true;
if(!swin);
}
#ifdef GC9A01_DRIVER
uint16_t pcol = alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg);
drawPixel(xp, yp, pcol);
swin = swin;
#else
if (swin) { setWindow(xp, yp, x1, yp); swin = false; }
pushColor(alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg));
@ -4973,7 +4973,10 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t *buf, uint16_t *index, uint16_t remaining)
** Function name: alphaBlend
** Description: Blend 16bit foreground and background
*************************************************************************************x*/
inline uint16_t TFT_eSPI::alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc)
#ifndef STM32
inline
#endif
uint16_t TFT_eSPI::alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc)
{
// Split out and blend 5 bit red and blue channels
uint32_t rxb = bgc & 0xF81F;
@ -5933,7 +5936,7 @@ void TFT_eSPI::setTextFont(uint8_t f)
** Function name: getSPIinstance
** Description: Get the instance of the SPI class
***************************************************************************************/
#if !defined (TFT_PARALLEL_8_BIT) && ! defined (RP2040_PIO_INTERFACE)
#if !defined (TFT_PARALLEL_8_BIT) && !defined (RP2040_PIO_INTERFACE)
SPIClass& TFT_eSPI::getSPIinstance(void)
{
return spi;