mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-05 21:54:42 +02:00
Remove setAddressWindow change for ESP32
Corner case caused missed graphics.
This commit is contained in:
45
TFT_eSPI.cpp
45
TFT_eSPI.cpp
@@ -185,8 +185,8 @@ TFT_eSPI::TFT_eSPI(int16_t w, int16_t h)
|
|||||||
|
|
||||||
_booted = true;
|
_booted = true;
|
||||||
|
|
||||||
ys_row = ye_row = addr_row = 0xFFFF;
|
addr_row = 0xFFFF;
|
||||||
xs_col = xe_col = addr_col = 0xFFFF;
|
addr_col = 0xFFFF;
|
||||||
|
|
||||||
#ifdef LOAD_GLCD
|
#ifdef LOAD_GLCD
|
||||||
fontsloaded = 0x0002; // Bit 1 set
|
fontsloaded = 0x0002; // Bit 1 set
|
||||||
@@ -2689,44 +2689,32 @@ void TFT_eSPI::setAddrWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1)
|
|||||||
|
|
||||||
CS_L_DC_C;
|
CS_L_DC_C;
|
||||||
|
|
||||||
// No need to send x if it has not changed (small speed-up of complex transparent Sprites and bitmaps)
|
tft_Write_8(TFT_CASET);
|
||||||
// Nb: caller must fill the set address area so that setting same area again will fill from xs, ys
|
|
||||||
if (xs_col != x0 || xe_col != x1) {
|
|
||||||
// Column addr set
|
|
||||||
|
|
||||||
tft_Write_8(TFT_CASET);
|
DC_D;
|
||||||
|
|
||||||
DC_D;
|
|
||||||
|
|
||||||
#if defined (RPI_ILI9486_DRIVER)
|
#if defined (RPI_ILI9486_DRIVER)
|
||||||
uint8_t xb[] = { 0, (uint8_t) (x0>>8), 0, (uint8_t) (x0>>0), 0, (uint8_t) (x1>>8), 0, (uint8_t) (x1>>0), };
|
uint8_t xb[] = { 0, (uint8_t) (x0>>8), 0, (uint8_t) (x0>>0), 0, (uint8_t) (x1>>8), 0, (uint8_t) (x1>>0), };
|
||||||
SPI.writePattern(&xb[0], 8, 1);
|
SPI.writePattern(&xb[0], 8, 1);
|
||||||
#else
|
#else
|
||||||
tft_Write_32(SPI_32(x0, x1));
|
tft_Write_32(SPI_32(x0, x1));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DC_C;
|
DC_C;
|
||||||
xs_col = x0; xe_col = x1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No need to send y if it has not changed
|
// Row addr set
|
||||||
if (ys_row != y0 || ye_row != y1) {
|
tft_Write_8(TFT_PASET);
|
||||||
|
|
||||||
// Row addr set
|
DC_D;
|
||||||
tft_Write_8(TFT_PASET);
|
|
||||||
|
|
||||||
DC_D;
|
|
||||||
|
|
||||||
#if defined (RPI_ILI9486_DRIVER)
|
#if defined (RPI_ILI9486_DRIVER)
|
||||||
uint8_t yb[] = { 0, (uint8_t) (y0>>8), 0, (uint8_t) (y0>>0), 0, (uint8_t) (y1>>8), 0, (uint8_t) (y1>>0), };
|
uint8_t yb[] = { 0, (uint8_t) (y0>>8), 0, (uint8_t) (y0>>0), 0, (uint8_t) (y1>>8), 0, (uint8_t) (y1>>0), };
|
||||||
SPI.writePattern(&yb[0], 8, 1);
|
SPI.writePattern(&yb[0], 8, 1);
|
||||||
#else
|
#else
|
||||||
tft_Write_32(SPI_32(y0, y1));
|
tft_Write_32(SPI_32(y0, y1));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DC_C;
|
DC_C;
|
||||||
ys_row = y0; ye_row = y1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// write to RAM
|
// write to RAM
|
||||||
tft_Write_8(TFT_RAMWR);
|
tft_Write_8(TFT_RAMWR);
|
||||||
@@ -3074,8 +3062,6 @@ void TFT_eSPI::drawPixel(uint32_t x, uint32_t y, uint32_t color)
|
|||||||
DC_C;
|
DC_C;
|
||||||
|
|
||||||
addr_col = x;
|
addr_col = x;
|
||||||
xs_col = xe_col = x;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need to send y if it has not changed (speeds things up)
|
// No need to send y if it has not changed (speeds things up)
|
||||||
@@ -3095,7 +3081,6 @@ void TFT_eSPI::drawPixel(uint32_t x, uint32_t y, uint32_t color)
|
|||||||
DC_C;
|
DC_C;
|
||||||
|
|
||||||
addr_row = y;
|
addr_row = y;
|
||||||
ys_row = ye_row = y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -784,8 +784,6 @@ class TFT_eSPI : public Print {
|
|||||||
uint32_t _init_width, _init_height; // Display w/h as input, used by setRotation()
|
uint32_t _init_width, _init_height; // Display w/h as input, used by setRotation()
|
||||||
uint32_t _width, _height; // Display w/h as modified by current rotation
|
uint32_t _width, _height; // Display w/h as modified by current rotation
|
||||||
uint32_t addr_row, addr_col;
|
uint32_t addr_row, addr_col;
|
||||||
uint32_t xs_col, xe_col;
|
|
||||||
uint32_t ys_row, ye_row;
|
|
||||||
|
|
||||||
uint32_t fontsloaded;
|
uint32_t fontsloaded;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user