Skip to content

Commit 887c409

Browse files
committed
Only wake up on press. Fixes issue with longer press and sleep
1 parent 351c60a commit 887c409

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/systemtask/SystemTask.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,14 @@ void SystemTask::Work() {
337337
break;
338338
case Messages::HandleButtonEvent: {
339339
// This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping
340-
if (IsSleeping()) {
341-
GoToRunning();
342-
break;
343-
}
344-
345340
Controllers::ButtonActions action;
346341
if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) {
347342
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release);
348343
} else {
344+
if (IsSleeping()) {
345+
GoToRunning();
346+
break;
347+
}
349348
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press);
350349
}
351350
HandleButtonAction(action);

0 commit comments

Comments
 (0)