summaryrefslogtreecommitdiff
path: root/src/components/datetime/DateTimeController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/datetime/DateTimeController.cpp')
-rw-r--r--src/components/datetime/DateTimeController.cpp14
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;