Skip to content

Commit

Permalink
format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveAmor committed Nov 7, 2021
1 parent 37de10f commit 822b6ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/components/datetime/DateTimeController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
minute = time.minutes().count();
second = time.seconds().count();

if (minute == 0 and not isHourAlreadyNotified) {
if (minute == 0 && !isHourAlreadyNotified) {
isHourAlreadyNotified = true;
if (systemTask != nullptr)
if (systemTask != nullptr) {
systemTask->PushMessage(System::Messages::OnNewHour);
}
} else if (minute != 0) {
isHourAlreadyNotified = false;
}

if ((minute == 0 or minute == 30) and not isHalfHourAlreadyNotified) {
if ((minute == 0 || minute == 30) && !isHalfHourAlreadyNotified) {
isHalfHourAlreadyNotified = true;
if (systemTask != nullptr)
if (systemTask != nullptr) {
systemTask->PushMessage(System::Messages::OnNewHalfHour);
} else if (minute != 0 and minute != 30) {
}
} else if (minute != 0 && minute != 30) {
isHalfHourAlreadyNotified = false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/systemtask/SystemTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ void SystemTask::Work() {
break;
case Messages::OnNewHour:
using Pinetime::Controllers::AlarmController;
if (settingsController.GetChimesState() == 1 and alarmController.State() != AlarmController::AlarmState::Alerting) {
if (settingsController.GetChimesState() == 1 && alarmController.State() != AlarmController::AlarmState::Alerting) {
if (isSleeping && !isWakingUp) {
GoToRunning();
displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock);
Expand All @@ -364,7 +364,7 @@ void SystemTask::Work() {
break;
case Messages::OnNewHalfHour:
using Pinetime::Controllers::AlarmController;
if (settingsController.GetChimesState() == 2 and alarmController.State() != AlarmController::AlarmState::Alerting) {
if (settingsController.GetChimesState() == 2 && alarmController.State() != AlarmController::AlarmState::Alerting) {
if (isSleeping && !isWakingUp) {
GoToRunning();
displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock);
Expand Down

0 comments on commit 822b6ae

Please sign in to comment.