chipKIT® Development Platform

Inspired by Arduino™

Reduce size TFT library

Created Fri, 25 Sep 2015 10:00:35 +0000 by YOBE.


YOBE.

Fri, 25 Sep 2015 10:00:35 +0000

Hello, after looking around on internet I installed DisplayCore and ST7735. But after compiling the included example "Milis", this seems to consume amazing amount of memory. Is this normal? I tried to reduce the size of the lib because lots of functions like "circle, triangle, ..." are not needed. But now always get compiling errors. Is there a way to reduce the size?

Thanks a lot


majenko

Fri, 25 Sep 2015 19:13:26 +0000

Yes, it is normal, and I am working on ways to reduce it. Part of the problem is the amount of inheritance that takes place for the polymorphism. I am looking at breaking out code into external functions and reducing the inherited code (ideally making the base class a pure virtual interface) so that the compiler is better able to optimize away the code that's not being used. It's a mammoth task though, and one that is somewhat complex.

I am also toying with the idea of implementing "graphics contexts" so all the graphical drawing functions (lines, circles, rectangles, etc) are in a completely separate Graphics object that you acquire from the DisplayCore based object you have created. Kind of like Java does with its Graphics2D objects.

Until then, DisplayCore is really only at home on the more powerful chips like the MX795.