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

@@ -75,6 +75,22 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
minute = time.minutes().count();
second = time.seconds().count();
if(minute == 0 and not isHourAlreadyNotified) {
isHourAlreadyNotified = true;
if(systemTask != nullptr)
systemTask->PushMessage(System::Messages::OnNewHour);
} else if (minute != 0) {
isHourAlreadyNotified = false;
}
if((minute == 0 or minute == 30) and not isHalfHourAlreadyNotified) {
isHalfHourAlreadyNotified = true;
if(systemTask != nullptr)
systemTask->PushMessage(System::Messages::OnNewHalfHour);
} else if (minute != 0 and minute != 30) {
isHalfHourAlreadyNotified = false;
}
// Notify new day to SystemTask
if (hour == 0 and not isMidnightAlreadyNotified) {
isMidnightAlreadyNotified = true;