Tufty 2040 v.1.19.12

Here is an interesting one…

I am using the main.py (nothing modified, other then changing the pen_type to RGB565). It works no issues.

Then I wrote a quick program to display a photo, same basic items. Pen_Type = 565, no progressive jpeg. It works, no issues; displays correctly in all its 565 colour photo glory.

Now when I “call” that same photo program from main.py, it somehow reverts to 332. But if you run it, straight out (in Thony) it is works nicely.

Has the new firmware changed how it ‘passes’ the pen_type? (which really it shouldn’t – as both main.py and the photo program are 565.

(( I removed all of the extra blank lines so you can see the entire photo program )) –

(( Updated w/ testing using 1.19.12 code ))

Fixed that issue by reflashing the unit. Now I get the (standard) error - which I can understand:


Traceback (most recent call last):
File “”, line 122, in
File “”, line 64, in launch_application
File “lego_badge.py”, line 25, in
MemoryError: memory allocation failed, allocating 17824 bytes


I know I can rename my (photo) program → main.py and it runs just fine in 565.

BUT…

Is there a way to launch a program from main.py clearing out some of its used memory for the new process/application?