HR Sensor : Add start/stop button to the HeartRate app (the HR sensors stays ON when the app is closed), display the HR value on the Clock app.

This commit is contained in:
Jean-François Milants
2021-01-17 10:39:46 +01:00
parent c82c22650c
commit 04063cf0af
12 changed files with 98 additions and 35 deletions

View File

@@ -141,6 +141,7 @@ void SystemTask::Work() {
displayApp->PushMessage(Applications::DisplayApp::Messages::GoToRunning);
displayApp->PushMessage(Applications::DisplayApp::Messages::UpdateBatteryLevel);
heartRateApp->PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp);
isSleeping = false;
isWakingUp = false;
@@ -150,6 +151,7 @@ void SystemTask::Work() {
NRF_LOG_INFO("[systemtask] Going to sleep");
xTimerStop(idleTimer, 0);
displayApp->PushMessage(Pinetime::Applications::DisplayApp::Messages::GoToSleep);
heartRateApp->PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
break;
case Messages::OnNewTime:
ReloadIdleTimer();
@@ -195,12 +197,6 @@ void SystemTask::Work() {
isSleeping = true;
isGoingToSleep = false;
break;
case Messages::HeartRateRunning:
doNotGoToSleep = true;
break;
case Messages::HeartRateStopped:
doNotGoToSleep = false;
break;
default: break;
}
}