You've already forked TEF6686_ESP32
updates, and on dp666 the date should be wrong on startup
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
#define TFT_NOP 0x00
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0xDD
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
|
||||
#define ILI9341_SLPOUT 0x11
|
||||
#define ILI9341_NORON 0x13
|
||||
|
||||
#define ILI9341_GAMMASET 0x26
|
||||
#define ILI9341_DISPON 0x29
|
||||
|
||||
#define ILI9341_MADCTL 0x36
|
||||
#define ILI9341_PIXFMT 0x3A
|
||||
|
||||
#define ILI9341_FRMCTR1 0xB1
|
||||
#define ILI9341_DFUNCTR 0xB6
|
||||
|
||||
#define ILI9341_PWCTR1 0xC0
|
||||
#define ILI9341_PWCTR2 0xC1
|
||||
#define ILI9341_VMCTR1 0xC5
|
||||
#define ILI9341_VMCTR2 0xC7
|
||||
|
||||
#define ILI9341_GMCTRP1 0xE0
|
||||
#define ILI9341_GMCTRN1 0xE1
|
||||
|
||||
#define ILI9341_MADCTL_MY 0x80
|
||||
#define ILI9341_MADCTL_MX 0x40
|
||||
#define ILI9341_MADCTL_MV 0x20
|
||||
#define ILI9341_MADCTL_ML 0x10
|
||||
#define ILI9341_MADCTL_RGB 0x00
|
||||
#define ILI9341_MADCTL_BGR 0x08
|
||||
#define ILI9341_MADCTL_MH 0x04
|
||||
@@ -105,7 +105,7 @@
|
||||
writecommand(ILI9341_SLPOUT); //Exit Sleep
|
||||
|
||||
end_tft_write();
|
||||
delay(80);
|
||||
delay(60);
|
||||
begin_tft_write();
|
||||
|
||||
writecommand(ILI9341_DISPON); //Display on
|
||||
|
||||
@@ -316,7 +316,7 @@ TFT_eSPI::TFT_eSPI(int16_t w, int16_t h) {
|
||||
textwrapX = false;
|
||||
textdatum = TL_DATUM;
|
||||
|
||||
_swapBytes = false;
|
||||
_swapBytes = true;
|
||||
|
||||
booted = true;
|
||||
|
||||
@@ -404,7 +404,7 @@ void TFT_eSPI::init() {
|
||||
gpio_set_level((gpio_num_t)TFT_RST, 1);
|
||||
}
|
||||
|
||||
delay(50); // Wait for reset to complete
|
||||
delay(35); // Wait for reset to complete
|
||||
|
||||
begin_tft_write();
|
||||
|
||||
@@ -3079,7 +3079,7 @@ TFT_eSprite::TFT_eSprite(TFT_eSPI *tft) {
|
||||
_iwidth = 0; // Initialise width and height to 0 (it does not exist yet)
|
||||
_iheight = 0;
|
||||
_bpp = 16;
|
||||
_swapBytes = false; // Do not swap pushImage colour bytes by default
|
||||
_swapBytes = true; // Do not swap pushImage colour bytes by default
|
||||
|
||||
_created = false;
|
||||
_vpOoB = true;
|
||||
@@ -3310,40 +3310,29 @@ void TFT_eSprite::pushSprite(int32_t x, int32_t y)
|
||||
{
|
||||
if (!_created) return;
|
||||
|
||||
if (_bpp == 16)
|
||||
{
|
||||
if (_bpp == 16) {
|
||||
bool oldSwapBytes = _tft->getSwapBytes();
|
||||
_tft->setSwapBytes(false);
|
||||
_tft->pushImage(x, y, _dwidth, _dheight, _img );
|
||||
_tft->setSwapBytes(oldSwapBytes);
|
||||
}
|
||||
else if (_bpp == 4)
|
||||
{
|
||||
} else if (_bpp == 4) {
|
||||
_tft->pushImage(x, y, _dwidth, _dheight, _img4, false, _colorMap);
|
||||
}
|
||||
else _tft->pushImage(x, y, _dwidth, _dheight, _img8, (bool)(_bpp == 8));
|
||||
} else _tft->pushImage(x, y, _dwidth, _dheight, _img8, (bool)(_bpp == 8));
|
||||
}
|
||||
|
||||
void TFT_eSprite::pushSprite(int32_t x, int32_t y, uint16_t transp)
|
||||
{
|
||||
if (!_created) return;
|
||||
|
||||
if (_bpp == 16)
|
||||
{
|
||||
if (_bpp == 16) {
|
||||
bool oldSwapBytes = _tft->getSwapBytes();
|
||||
_tft->setSwapBytes(false);
|
||||
_tft->pushImage(x, y, _dwidth, _dheight, _img, transp );
|
||||
_tft->setSwapBytes(oldSwapBytes);
|
||||
}
|
||||
else if (_bpp == 8)
|
||||
{
|
||||
} else if (_bpp == 8) {
|
||||
transp = (uint8_t)((transp & 0xE000)>>8 | (transp & 0x0700)>>6 | (transp & 0x0018)>>3);
|
||||
_tft->pushImage(x, y, _dwidth, _dheight, _img8, (uint8_t)transp, (bool)true);
|
||||
}
|
||||
else if (_bpp == 4)
|
||||
{
|
||||
_tft->pushImage(x, y, _dwidth, _dheight, _img4, (uint8_t)(transp & 0x0F), false, _colorMap);
|
||||
}
|
||||
} else if (_bpp == 4) _tft->pushImage(x, y, _dwidth, _dheight, _img4, (uint8_t)(transp & 0x0F), false, _colorMap);
|
||||
else _tft->pushImage(x, y, _dwidth, _dheight, _img8, 0, (bool)false);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,54 @@
|
||||
#define TFT_WIDTH 240
|
||||
#define TFT_HEIGHT 320
|
||||
|
||||
#include <ILI9341_Defines.h>
|
||||
#define TFT_NOP 0x00
|
||||
|
||||
#define TFT_INVOFF 0x20
|
||||
#define TFT_INVON 0x21
|
||||
|
||||
#define TFT_CASET 0x2A
|
||||
#define TFT_PASET 0x2B
|
||||
#define TFT_RAMWR 0x2C
|
||||
|
||||
#define TFT_RAMRD 0x2E
|
||||
#define TFT_IDXRD 0xDD
|
||||
|
||||
#define TFT_MADCTL 0x36
|
||||
#define TFT_MAD_MY 0x80
|
||||
#define TFT_MAD_MX 0x40
|
||||
#define TFT_MAD_MV 0x20
|
||||
#define TFT_MAD_ML 0x10
|
||||
#define TFT_MAD_BGR 0x08
|
||||
#define TFT_MAD_MH 0x04
|
||||
#define TFT_MAD_RGB 0x00
|
||||
|
||||
#define ILI9341_SLPOUT 0x11
|
||||
#define ILI9341_NORON 0x13
|
||||
|
||||
#define ILI9341_GAMMASET 0x26
|
||||
#define ILI9341_DISPON 0x29
|
||||
|
||||
#define ILI9341_MADCTL 0x36
|
||||
#define ILI9341_PIXFMT 0x3A
|
||||
|
||||
#define ILI9341_FRMCTR1 0xB1
|
||||
#define ILI9341_DFUNCTR 0xB6
|
||||
|
||||
#define ILI9341_PWCTR1 0xC0
|
||||
#define ILI9341_PWCTR2 0xC1
|
||||
#define ILI9341_VMCTR1 0xC5
|
||||
#define ILI9341_VMCTR2 0xC7
|
||||
|
||||
#define ILI9341_GMCTRP1 0xE0
|
||||
#define ILI9341_GMCTRN1 0xE1
|
||||
|
||||
#define ILI9341_MADCTL_MY 0x80
|
||||
#define ILI9341_MADCTL_MX 0x40
|
||||
#define ILI9341_MADCTL_MV 0x20
|
||||
#define ILI9341_MADCTL_ML 0x10
|
||||
#define ILI9341_MADCTL_RGB 0x00
|
||||
#define ILI9341_MADCTL_BGR 0x08
|
||||
#define ILI9341_MADCTL_MH 0x04
|
||||
|
||||
#include <pgmspace.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user