mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-07 06:34:44 +02:00
4 bpp Sprite bug fix
OR has precedence over AND so brackets needed. Remove unused varaible.
This commit is contained in:
@@ -831,7 +831,6 @@ uint8_t TFT_eSprite::readPixelValue(int32_t x, int32_t y)
|
||||
|
||||
if (_bpp == 4)
|
||||
{
|
||||
uint16_t color;
|
||||
if ((x & 0x01) == 0)
|
||||
return ((_img4[((x+y*_iwidth)>>1)] & 0xF0) >> 4) & 0x0F; // even index = bits 7 .. 4
|
||||
else
|
||||
@@ -1639,14 +1638,14 @@ void TFT_eSprite::drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color)
|
||||
{
|
||||
uint8_t c = (uint8_t) (color & 0xF) << 4;
|
||||
while (h--) {
|
||||
_img4[(x + _iwidth * y)>>1] = (uint8_t) (c | _img4[(x + _iwidth * y)>>1] & 0x0F);
|
||||
_img4[(x + _iwidth * y)>>1] = (uint8_t) (c | (_img4[(x + _iwidth * y)>>1] & 0x0F));
|
||||
y++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uint8_t c = (uint8_t)color & 0xF;
|
||||
while (h--) {
|
||||
_img4[(x - 1 + _iwidth * y)>>1] = (uint8_t) (c | _img4[(x - 1 + _iwidth * y)>>1] & 0xF0); // x is odd; new color goes into the low bits.
|
||||
_img4[(x - 1 + _iwidth * y)>>1] = (uint8_t) (c | (_img4[(x - 1 + _iwidth * y)>>1] & 0xF0)); // x is odd; new color goes into the low bits.
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#ifndef _TFT_eSPIH_
|
||||
#define _TFT_eSPIH_
|
||||
|
||||
#define TFT_ESPI_VERSION "2.0.1"
|
||||
#define TFT_ESPI_VERSION "2.0.2"
|
||||
|
||||
/***************************************************************************************
|
||||
** Section 1: Load required header files
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TFT_eSPI",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"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":
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name=TFT_eSPI
|
||||
version=2.0.1
|
||||
version=2.0.2
|
||||
author=Bodmer
|
||||
maintainer=Bodmer
|
||||
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
|
||||
|
Reference in New Issue
Block a user