TFT_eSPI_ext icon indicating copy to clipboard operation
TFT_eSPI_ext copied to clipboard

Double instance of TFT_eSpi in ram when we use sprite

Open EcoApi opened this issue 3 years ago • 1 comments

TFT_eSPI_ext is an instance of TFT_eSPI why we need double instance ?

for exemple my display have this format (w 135, h 240)

TFT_eSPI tft = TFT_eSPI();
TFT_eSprite tftSprite = TFT_eSprite(&tft); TFT_eSPI_ext tftExt = TFT_eSPI_ext(&tft); /* why need this argument */

Normaly we must passed TFT_eSPI_ext in TFT_eSprite instance and TFT_eSPI tft = TFT_eSPI(); was not needed.

in setup : // Boot Screen tft.begin(); /* not work if this call is not present*/ tft.setRotation(1); /* not work if this call is not present*/ tftExt.begin(); /* double intance of TFT_eSPI !!!! bug post issue in Bodmer repo */ tftExt.setRotation(1); tftExt.setTextColor(TFT_WHITE, TFT_BLUE); tftExt.fillScreen(TFT_BLUE);

tftSprite.createSprite(IWIDTH, IHEIGHT); tftExt.TTFdestination(&tftSprite);

in loop: tftSprite.fillSprite(TFT_BLUE); tftSprite.drawXBitmap(WIDTH(0), HEIGHT(0), t_logoBee1.logo, t_logoBee1.width, t_logoBee1.height, TFT_WHITE); tftExt.setTTFont(CourierNew_14_Bold); tftExt.setCursor(WIDTH(85), HEIGHT(27)); tftExt.print("Test A"); tftExt.setCursor(WIDTH(75), HEIGHT(43)); tftExt.print("Test B"); tftExt.setTTFont(CourierNew_8_Bold); tftExt.setCursor(WIDTH(85), HEIGHT(64)); tftExt.print("v.0.0.0"); tftSprite.pushSprite(0, 0);

EcoApi avatar Oct 01 '22 20:10 EcoApi

I have not noticed this issue. RAM use seems consistent with 1 copy, however my test case may be different.

Can you generate a pull request with the solution? Thanks.

Bodmer avatar Dec 27 '22 23:12 Bodmer