Only wake up on press. Fixes issue with longer press and sleep
This commit is contained in:
parent
351c60a131
commit
887c409b13
|
@ -337,15 +337,14 @@ void SystemTask::Work() {
|
||||||
break;
|
break;
|
||||||
case Messages::HandleButtonEvent: {
|
case Messages::HandleButtonEvent: {
|
||||||
// This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping
|
// This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping
|
||||||
if (IsSleeping()) {
|
|
||||||
GoToRunning();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Controllers::ButtonActions action;
|
Controllers::ButtonActions action;
|
||||||
if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) {
|
if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) {
|
||||||
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release);
|
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release);
|
||||||
} else {
|
} else {
|
||||||
|
if (IsSleeping()) {
|
||||||
|
GoToRunning();
|
||||||
|
break;
|
||||||
|
}
|
||||||
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press);
|
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press);
|
||||||
}
|
}
|
||||||
HandleButtonAction(action);
|
HandleButtonAction(action);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user