diff options
| -rw-r--r-- | src/components/alarm/AlarmController.cpp | 6 | ||||
| -rw-r--r-- | src/components/alarm/AlarmController.h | 1 | ||||
| -rw-r--r-- | src/systemtask/SystemTask.cpp | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index cea679f..a08bfbd 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -99,6 +99,12 @@ void AlarmController::SetOffAlarmNow() { void AlarmController::StopAlerting() { systemTask->PushMessage(System::Messages::StopRinging); +} + +void AlarmController::OnStopRinging() { + if (state != AlarmState::Alerting) { + return; + } // Alarm state is off unless this is a recurring alarm if (recurrence == RecurType::None) { diff --git a/src/components/alarm/AlarmController.h b/src/components/alarm/AlarmController.h index fb33edb..3c66775 100644 --- a/src/components/alarm/AlarmController.h +++ b/src/components/alarm/AlarmController.h @@ -38,6 +38,7 @@ namespace Pinetime { void SetOffAlarmNow(); uint32_t SecondsToAlarm(); void StopAlerting(); + void OnStopRinging(); enum class AlarmState { Not_Set, Set, Alerting }; enum class RecurType { None, Daily, Weekdays }; uint8_t Hours() const { diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 38c728f..c7e0f38 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -319,6 +319,7 @@ void SystemTask::Work() { break; case Messages::StopRinging: motorController.StopRinging(); + alarmController.OnStopRinging(); break; case Messages::BleConnected: ReloadIdleTimer(); |
