diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-05-12 00:19:59 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-05-12 00:19:59 (GMT) |
| commit | 72d0f103a8bc1048ff9729aee65070475977b5a3 (patch) | |
| tree | 6a806507701dcbea7eb30fa0351de9f3e59d7f56 /src/components/alarm/AlarmController.h | |
| parent | 1ff0a48bbb66f8099c1451fa02983655003def8e (diff) | |
| parent | aca605d4fb4040cc80c1acf101023aa86e7694ba (diff) | |
Merge branch 'alarm-reliability-and-switch-to-freertos-timers' into analog24
Diffstat (limited to 'src/components/alarm/AlarmController.h')
| -rw-r--r-- | src/components/alarm/AlarmController.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/alarm/AlarmController.h b/src/components/alarm/AlarmController.h index f39fbde..6ad220f 100644 --- a/src/components/alarm/AlarmController.h +++ b/src/components/alarm/AlarmController.h @@ -17,6 +17,8 @@ */ #pragma once +#include <FreeRTOS.h> +#include <timers.h> #include <cstdint> #include "components/datetime/DateTimeController.h" @@ -29,9 +31,9 @@ namespace Pinetime { public: AlarmController(Controllers::DateTime& dateTimeController); - void Init(System::SystemTask* systemTask); void SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin); void ScheduleAlarm(); + void OnAdjustTime(); void DisableAlarm(); void SetOffAlarmNow(); uint32_t SecondsToAlarm(); @@ -54,9 +56,15 @@ namespace Pinetime { recurrence = recurType; } + protected: + friend class Pinetime::System::SystemTask; + void Init(System::SystemTask* systemTask); + void OnStopRinging(); + private: Controllers::DateTime& dateTimeController; System::SystemTask* systemTask = nullptr; + TimerHandle_t alarmAppTimer; uint8_t hours = 7; uint8_t minutes = 0; std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> alarmTime; |
