Skip to content

Commit

Permalink
Set the led state for shutdown cancellation in ShutdownButton and use…
Browse files Browse the repository at this point in the history
… this value
  • Loading branch information
topas-rec committed May 10, 2023
1 parent 0152b42 commit 00a51fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions components/gpio_control/GPIODevices/shutdown_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@ def callbackFunctionHandler(self, *args):
# leave it on for the moment, it will be off when the system is down
self.when_pressed(*args)
else:
# leave LED on if pressing was cancelled early (during flashing) and status led uses the same pin as shutdown led
if status_led.GPIO and (status_led.GPIO is self.led_pin):
self.set_led(GPIO.HIGH)
else:
self.set_led(GPIO.LOW)
# switch off LED if pressing was cancelled early (during flashing)
self.set_led(self.led_state_shutdown_cancelled)


def __repr__(self):
Expand Down
2 changes: 2 additions & 0 deletions components/gpio_control/gpio_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def gpio_loop(self):
gpio_controler = gpio_control(phoniebox_function_calls)

devices = gpio_controler.get_all_devices(config)
# Sets the led value at the shutdown button that should be used in case of the shutdown
# sequence is cancelled if StatusLED and ShutdownLED use the sampe GPIO
gpio_controler.checkDevicesDependencies()
gpio_controler.print_all_devices()
gpio_controler.gpio_loop()

0 comments on commit 00a51fd

Please sign in to comment.