diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-03-31 12:35:17 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-03-31 12:35:17 (GMT) |
| commit | 04dd0c5fe0c696c815b0df1243c1003cd4464dbb (patch) | |
| tree | 9bedc44c956ad18adb07f664397500667fce910d /src/components/datetime/DateTimeController.cpp | |
| parent | 043517f85124810310e5a854fb02b52fb9feccb3 (diff) | |
add back chimes and flashlight
Diffstat (limited to 'src/components/datetime/DateTimeController.cpp')
| -rw-r--r-- | src/components/datetime/DateTimeController.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index 6022474..8bf5fb9 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -80,6 +80,24 @@ void DateTime::UpdateTime(uint32_t systickCounter) { minute = time.minutes().count(); second = time.seconds().count(); + if (minute == 0 && !isHourAlreadyNotified) { + isHourAlreadyNotified = true; + if (systemTask != nullptr) { + systemTask->PushMessage(System::Messages::OnNewHour); + } + } else if (minute != 0) { + isHourAlreadyNotified = false; + } + + if ((!(minute%5)) && !isHalfHourAlreadyNotified) { + isHalfHourAlreadyNotified = true; + if (systemTask != nullptr) { + systemTask->PushMessage(System::Messages::OnChime); + } + } else if (!!(minute%5)) { + isHalfHourAlreadyNotified = false; + } + // Notify new day to SystemTask if (hour == 0 and not isMidnightAlreadyNotified) { isMidnightAlreadyNotified = true; |
