Chimes option

This commit is contained in:
SteveAmor
2021-11-07 10:50:33 +00:00
parent 0aa73c2279
commit 5932391c8b
12 changed files with 179 additions and 2 deletions

View File

@@ -352,6 +352,26 @@ void SystemTask::Work() {
// Remember we'll have to reset the counter next time we're awake
stepCounterMustBeReset = true;
break;
case Messages::OnNewHour:
using Pinetime::Controllers::AlarmController;
if (settingsController.GetChimesState() == 1 and alarmController.State() != AlarmController::AlarmState::Alerting) {
if (isSleeping && !isWakingUp) {
GoToRunning();
displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock);
}
motorController.RunForDuration(35);
}
break;
case Messages::OnNewHalfHour:
using Pinetime::Controllers::AlarmController;
if (settingsController.GetChimesState() == 2 and alarmController.State() != AlarmController::AlarmState::Alerting) {
if (isSleeping && !isWakingUp) {
GoToRunning();
displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock);
}
motorController.RunForDuration(35);
}
break;
case Messages::OnChargingEvent:
batteryController.ReadPowerState();
motorController.RunForDuration(15);