I initially observed this in CircuitPython with rgbmatrix but the problem happens when using Protomatter directly, so it's not a CircuitPython issue. To reproduce, display an image on an LED matrix screen and write to a file. The image will briefly be distorted.
I made minimal changes to the simple example to demonstrate the problem: I added code to set up a FAT filesystem and when the UP button is pressed, it writes a file, waits a second, reads the file, waits a second and writes the file again.
This demonstrates:
display corruption when a file is written after the button is pressed
no display corruption when a file is read
display corruption when a file is written and the button isn't being pressed
If you press the DOWN button it opens Preferences, writes an item, and closes Preferences. Preferences are also stored in flash. This does not trigger the issue, which seems to indicate that it's possible to write to flash without interfering with the display timing.
In either case hold the button for at least a second for it to register; I made a minimal set of changes to the example and didn't change the timing in loop().
I know the underlying code dealing with the hardware is totally different, but can say that the Matrix Portal M4 doesn't exhibit this issue.
Enabling double buffering doesn't change the behavior.
This video shows what I see when a Protomatter program writes to a file, twice, separated by two seconds:
I initially observed this in CircuitPython with
rgbmatrix
but the problem happens when using Protomatter directly, so it's not a CircuitPython issue. To reproduce, display an image on an LED matrix screen and write to a file. The image will briefly be distorted.I made minimal changes to the
simple
example to demonstrate the problem: I added code to set up a FAT filesystem and when the UP button is pressed, it writes a file, waits a second, reads the file, waits a second and writes the file again.This demonstrates:
If you press the DOWN button it opens Preferences, writes an item, and closes Preferences. Preferences are also stored in flash. This does not trigger the issue, which seems to indicate that it's possible to write to flash without interfering with the display timing.
In either case hold the button for at least a second for it to register; I made a minimal set of changes to the example and didn't change the timing in
loop()
.I know the underlying code dealing with the hardware is totally different, but can say that the Matrix Portal M4 doesn't exhibit this issue.
Enabling double buffering doesn't change the behavior.
This video shows what I see when a Protomatter program writes to a file, twice, separated by two seconds:
https://github.com/adafruit/Adafruit_Protomatter/assets/58883/7a9bc2c2-e654-44d4-be27-db139132b0de
Demo - run this on a Matrix Portal S3, hold UP for a second to trigger two writes: