Double instance of TFT_eSpi in ram when we use sprite
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);
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.