Hello again. I was able to drive my st7789 screen but I can't create 240x280 px sprites while I can create 240x250 px sprites. What could be the reason for this? #2356
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You are out of RAM..... Try making the sprite 8 bit. img.setColorDepth(8); Default is 16 bit and takes more ram. |
Beta Was this translation helpful? Give feedback.
-
For sprites that are being used for the entire duration of the sketch and don't need to be deallocated, it would be useful to add to the library the possibility of statically allocated buffers for them, so the user could get a clear indication at link-time that they don't fit in memory. Of course if the processor being used has PSRAM the library is aware of it, and statically allocating in RAM would be detrimental. template <size_t W, size_t H, uint8_t BPP = 16>
class TFT_eSpriteStatic: public TFT_eSprite; that when instantiated with TFT_eSpriteStatic<240, 280> sprite; will compile but will make the linker show an out of RAM error. |
Beta Was this translation helpful? Give feedback.
You are out of RAM.....
Try making the sprite 8 bit.
img.setColorDepth(8);
Default is 16 bit and takes more ram.