Fix #417 and add for 135x240 display

Setup 135 is for TTGO T Display (ESP32)
Plus minor tweaks to avoid some warnings
This commit is contained in:
Bodmer
2019-10-07 17:56:17 +01:00
parent 9a84fb156b
commit d3210a7ee6
7 changed files with 59 additions and 8 deletions
+15 -3
View File
@@ -464,7 +464,13 @@ void TFT_eSprite::pushSprite(int32_t x, int32_t y)
{
if (!_created) return;
if (_bpp == 16) _tft->pushImage(x, y, _iwidth, _iheight, _img );
if (_bpp == 16)
{
bool oldSwapBytes = _tft->getSwapBytes();
_tft->setSwapBytes(false);
_tft->pushImage(x, y, _iwidth, _iheight, _img );
_tft->setSwapBytes(oldSwapBytes);
}
else _tft->pushImage(x, y, _dwidth, _dheight, _img8, (bool)(_bpp == 8));
}
@@ -478,7 +484,13 @@ void TFT_eSprite::pushSprite(int32_t x, int32_t y, uint16_t transp)
{
if (!_created) return;
if (_bpp == 16) _tft->pushImage(x, y, _iwidth, _iheight, _img, transp );
if (_bpp == 16)
{
bool oldSwapBytes = _tft->getSwapBytes();
_tft->setSwapBytes(false);
_tft->pushImage(x, y, _iwidth, _iheight, _img, transp );
_tft->setSwapBytes(oldSwapBytes);
}
else if (_bpp == 8)
{
transp = (uint8_t)((transp & 0xE000)>>8 | (transp & 0x0700)>>6 | (transp & 0x0018)>>3);
@@ -716,7 +728,7 @@ void TFT_eSprite::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const u
uint32_t ww = (w+7) & 0xFFF8;
for (int32_t yp = 0; yp<h; yp++)
{
for (int32_t xp = 0; xp<ww; xp+=8)
for (uint32_t xp = 0; xp<ww; xp+=8)
{
uint8_t pbyte = pgm_read_byte(pdata++);
for (uint8_t xc = 0; xc < 8; xc++)