[WelcomeScreen.py] Improved the interrupt functionality
This commit is contained in:
parent
12e8fa43ab
commit
1614247f0d
@ -73,8 +73,8 @@ class WelcomeScreen:
|
|||||||
self.lcd.putstr(padding_hyphen)
|
self.lcd.putstr(padding_hyphen)
|
||||||
|
|
||||||
# get the current pin values (only if there are pins specified) (when something changes, the interrupt happens and the cycle stops)
|
# get the current pin values (only if there are pins specified) (when something changes, the interrupt happens and the cycle stops)
|
||||||
|
break_flag = False
|
||||||
if self.interrupt_pins:
|
if self.interrupt_pins:
|
||||||
break_flag = False
|
|
||||||
pin_values = []
|
pin_values = []
|
||||||
for p in self.interrupt_pins:
|
for p in self.interrupt_pins:
|
||||||
pin_values.append(p.value())
|
pin_values.append(p.value())
|
||||||
@ -92,8 +92,10 @@ class WelcomeScreen:
|
|||||||
for i, p in enumerate(self.interrupt_pins):
|
for i, p in enumerate(self.interrupt_pins):
|
||||||
if pin_values[i] != p.value():
|
if pin_values[i] != p.value():
|
||||||
break_flag = True
|
break_flag = True
|
||||||
if break_flag:
|
if break_flag:
|
||||||
break
|
break
|
||||||
|
if break_flag:
|
||||||
|
break
|
||||||
|
|
||||||
self.lcd.move_to(0,y_offset)
|
self.lcd.move_to(0,y_offset)
|
||||||
self.lcd.putstr(self.started_msg.center(16))
|
self.lcd.putstr(self.started_msg.center(16))
|
||||||
|
Loading…
Reference in New Issue
Block a user