piface / pifacecad

PiFace Control and Display
GNU General Public License v3.0
46 stars 38 forks source link

Occasional garbage text on LCD after fast writes #8

Closed sshivaji closed 10 years ago

sshivaji commented 10 years ago

The issue is very similar to https://github.com/piface/libpifacecad/issues/1 In the python library, is the an equivalent of DELAY_SETTLE_NS that we can use? I tried issuing sleep(1), while it helped, it did not fully solve the issue. This issue occurs with an app that refreshes the screen every second.

Do you have general recommendations or knobs that can be tweaked from the python api?

sshivaji commented 10 years ago

I found some knobs to tune in lcd.py, they again seem to help but not resolve the issue fully. I will investigate more. I might have a similar issue where 2 threads are writing to the LCD and the race condition is likely causing garbage output.

sshivaji commented 10 years ago

Update: that seems to have fixed the problem (putting in a lock when doing writes from 2 threads).

If you see garbled text on the Piface display, there is a good chance you have code from 2 (or more threads) writing to the display simultaneously. It makes sense to use a Lock() in these cases.

Closing this issue as its now a dup of the parent issue - piface/libpifacecad#1