Merge pull request #949 from Riksu9000/fix_alarm

Fix alarm on time change
This commit is contained in:
JF 2022-01-26 22:03:14 +01:00 committed by GitHub
commit e73a92c29b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -36,6 +36,8 @@ void DateTime::SetTime(
UpdateTime(systickCounter); UpdateTime(systickCounter);
NRF_LOG_INFO("* %d %d %d ", this->hour, this->minute, this->second); 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, this->month, this->year);
systemTask->PushMessage(System::Messages::OnNewTime);
} }
void DateTime::UpdateTime(uint32_t systickCounter) { void DateTime::UpdateTime(uint32_t systickCounter) {

View file

@ -296,6 +296,9 @@ void SystemTask::Work() {
case Messages::OnNewTime: case Messages::OnNewTime:
ReloadIdleTimer(); ReloadIdleTimer();
displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime); displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime);
if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) {
alarmController.ScheduleAlarm();
}
break; break;
case Messages::OnNewNotification: case Messages::OnNewNotification:
if (settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::ON) { if (settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::ON) {