Skip to content

Commit 6c59025

Browse files
committed
set dirty to false sooner
to mitigate race condition that can happen during rapid updated
1 parent 88a0446 commit 6c59025

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

v3/as_drivers/hd44780/alcd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ async def runlcd(self): # Periodically check for changed text and update LCD if
100100
for row in range(self.rows):
101101
if self.dirty[row]:
102102
msg = self[row]
103+
self.dirty[row] = False
103104
self.lcd_byte(LCD.LCD_LINES[row], LCD.CMD)
104105
for thisbyte in msg:
105106
self.lcd_byte(ord(thisbyte), LCD.CHR)
106107
await asyncio.sleep_ms(0) # Reshedule ASAP
107-
self.dirty[row] = False
108108
await asyncio.sleep_ms(20) # Give other coros a look-in

0 commit comments

Comments
 (0)