From 1614247f0d63f3bef94a4b498db23ee0ac8f7821 Mon Sep 17 00:00:00 2001 From: BlueFox Date: Mon, 28 Oct 2024 18:54:44 +0000 Subject: [PATCH] [WelcomeScreen.py] Improved the interrupt functionality --- WelcomeScreen.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/WelcomeScreen.py b/WelcomeScreen.py index 82adc3a..a57da76 100644 --- a/WelcomeScreen.py +++ b/WelcomeScreen.py @@ -73,8 +73,8 @@ class WelcomeScreen: 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) + break_flag = False if self.interrupt_pins: - break_flag = False pin_values = [] for p in self.interrupt_pins: pin_values.append(p.value()) @@ -92,8 +92,10 @@ class WelcomeScreen: for i, p in enumerate(self.interrupt_pins): if pin_values[i] != p.value(): break_flag = True - if break_flag: - break + if break_flag: + break + if break_flag: + break self.lcd.move_to(0,y_offset) self.lcd.putstr(self.started_msg.center(16))