Cater for the case where another state change occurs while the ISR is running.

Thank you peterhinch
pull/6894/head
Sandor Attila Gerendi 2021-12-30 17:50:12 +02:00 zatwierdzone przez GitHub
rodzic 5366ead756
commit c79be30ca6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -66,6 +66,7 @@ lut_index = 0
def encoder_state_changed_irq_handler(sm):
global counter, direction, lut_index
while sm.rx_fifo():
lut_index |= sm.get() & 3
counter += state_look_up_table[lut_index]
if state_look_up_table[lut_index] != 0: