diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-04-10 13:25:41 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-04-10 14:07:20 (GMT) |
| commit | 4d8a0d3300345b71dcbd7e86d1e7c4cfcc3cf200 (patch) | |
| tree | 14e9254f671f5d77fc543509417fd19ac63f1f52 /src/components/datetime/DateTimeController.cpp | |
| parent | 42a64f15867a35ccdab44b3b2c09aa15fd6f9ae1 (diff) | |
New chimes engine
Diffstat (limited to 'src/components/datetime/DateTimeController.cpp')
| -rw-r--r-- | src/components/datetime/DateTimeController.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index fbaa01b..01e2859 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -38,7 +38,7 @@ void DateTime::SetTime( UpdateTime(systickCounter); NRF_LOG_INFO("* %d %d %d ", this->hour, this->minute, this->second); - NRF_LOG_INFO("* %d %d %d ", this->day, this->month, this->year); + NRF_LOG_INFO("* %d %d %d ", this->day, ((int)this->month), this->year); systemTask->PushMessage(System::Messages::OnNewTime); } @@ -82,15 +82,15 @@ void DateTime::UpdateTime(uint32_t systickCounter) { isHourAlreadyNotified = false; } - if ((minute == 0 || minute == 30) && !isHalfHourAlreadyNotified) { - isHalfHourAlreadyNotified = true; + if (minute%chimePeriod) { + hasChimed = false; + } else if (!hasChimed) { if (systemTask != nullptr) { - systemTask->PushMessage(System::Messages::OnNewHalfHour); + systemTask->PushMessage(System::Messages::OnChime); + hasChimed = true; } - } else if (minute != 0 && minute != 30) { - isHalfHourAlreadyNotified = false; } - + // Notify new day to SystemTask if (hour == 0 and not isMidnightAlreadyNotified) { isMidnightAlreadyNotified = true; |
