Unphone improvements (#172)

- Debounce nav button presses: This fixes multiple triggers on a single press to navigate back. Otherwise, more than 1 app would often close at the same time.
- Nav button respond to release instead of push down, because these buttons aren't super reliable in general. (I might change this in the future after more testing)
- Move single buzz earlier in boot phase, so that we can detect silent boot loops.
This commit is contained in:
Ken Van Hoeylandt
2025-01-19 21:40:26 +01:00
committed by GitHub
parent 72230129bb
commit 2bbd44a8b5
3 changed files with 43 additions and 27 deletions
+8 -10
View File
@@ -64,24 +64,22 @@ static bool unPhonePowerOn() {
unPhoneFeatures.printInfo();
// Vibrate once
// Note: Do this before power switching logic, to detect silent boot loops
unPhoneFeatures.setVibePower(true);
tt::kernel::delayMillis(150);
unPhoneFeatures.setVibePower(false);
// Turn off the device if power switch is on off state,
// instead of waiting for the Thread to start and continue booting
updatePowerSwitch();
startPowerSwitchThread();
unPhoneFeatures.setBacklightPower(false);
// Init touch screen GPIOs (used for vibe motor)
unPhoneFeatures.setVibePower(false);
unPhoneFeatures.setIrPower(false);
// This will be default LOW implicitly, but this makes it explicit
unPhoneFeatures.setExpanderPower(false);
// Vibrate once
unPhoneFeatures.setVibePower(true);
tt::kernel::delayMillis(150);
unPhoneFeatures.setVibePower(false);
return true;
}