Don't use wait_for_press because that waits for the button to be released

pull/285/head
Mike Bell 2022-03-09 23:53:56 +00:00
rodzic fefa6f8880
commit 6975610fdc
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -82,7 +82,12 @@ namespace pimoroni {
// If running on USB we will not actually power down, so emulate the behaviour
// of battery powered badge by listening for a button press and then resetting
wait_for_press();
// Note: Don't use wait_for_press as that waits for the button to be release and
// we want the reboot to complete before the button is released.
update_button_states();
while(_button_states == 0) {
update_button_states();
}
watchdog_reboot(0, 0, 0);
}