kopia lustrzana https://github.com/micropython/micropython
Cater for the case where another state change occurs while the ISR is running.
Thank you peterhinchpull/6894/head
rodzic
5366ead756
commit
c79be30ca6
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue