InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.76k stars 944 forks source link

Tap to wake? #228

Closed FlameKat53 closed 3 years ago

FlameKat53 commented 3 years ago

Hello, i would greatly enjoy the ability to tap to wake up my watch. here is the code and what you need to change it to.

code:

void SystemTask::OnTouchEvent() {
  if(isGoingToSleep) return ;
  NRF_LOG_INFO("[systemtask] Touch event");
  if(!isSleeping) {
    PushMessage(Messages::OnTouchEvent);
    displayApp->PushMessage(Pinetime::Applications::DisplayApp::Messages::TouchEvent);
  }
}

change to:

void SystemTask::OnTouchEvent() {
  if(isGoingToSleep) return ;
  NRF_LOG_INFO("[systemtask] Touch event");
  if(!isSleeping) {
    PushMessage(Messages::OnTouchEvent);
    displayApp->PushMessage(Pinetime::Applications::DisplayApp::Messages::TouchEvent);
  } 
  else {
      if(!isWakingUp) {
      NRF_LOG_INFO("[systemtask] Screen tapped, waking up");
      GoToRunning();
      }
    }
}
pfeerick commented 3 years ago

joaq's recent PRs have incorporated this - both single and double tap wake up options, and should be in 0.16. It is present in the develop branch as of https://github.com/JF002/InfiniTime/commit/17a37acaa81278cc8c782d84d994d4ca938ef006

JF002 commented 3 years ago

This feature (single tap, double tap and wrist raise to wake) were added in 1.0 ;)