Skip to content

Commit

Permalink
Made changes to the SnoozeAlarmTaskCallback, it uses the existing cod…
Browse files Browse the repository at this point in the history
…e in the OnButtonEvent function.

Also made sure to delete the task in some places.
  • Loading branch information
cyberneel committed Dec 20, 2024
1 parent ee73c34 commit 0e0e1f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/displayapp/screens/Sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ namespace {
lv_task_set_prio(task, LV_TASK_PRIO_OFF);
auto* screen = static_cast<Sleep*>(task->user_data);
screen->ignoreButtonPush = true;
screen->StopAlerting(false);
screen->UpdateDisplay();
screen->SnoozeWakeAlarm();
screen->displayState = Sleep::SleepDisplayState::Info;
screen->UpdateDisplay();
screen->OnButtonEvent(screen->btnSnooze, LV_EVENT_CLICKED);
screen->ignoreButtonPush = false;
}

Expand Down Expand Up @@ -709,6 +705,10 @@ void Sleep::RedrawSetAlerting() {
}

void Sleep::StopAlerting(bool setSwitch) {
if (taskSnoozeWakeAlarm != nullptr) {
lv_task_del(taskSnoozeWakeAlarm);
taskSnoozeWakeAlarm = nullptr;
}
infiniSleepController.StopAlerting();
if (infiniSleepController.infiniSleepSettings.naturalWake) {
motorController.StopNaturalWakeAlarm();
Expand Down
4 changes: 3 additions & 1 deletion src/displayapp/screens/Sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ namespace Pinetime {

bool ignoreButtonPush = false;

lv_obj_t *btnSnooze;

private:
System::WakeLock wakeLock;
Controllers::MotorController& motorController;
Controllers::Settings::ClockType clockType;
DisplayApp& displayApp;

lv_obj_t *btnStop, *btnSnooze, *txtStop, *txtSnooze, /**btnRecur, *txtRecur,*/ *btnInfo, *enableSwitch;
lv_obj_t *btnStop, *txtStop, *txtSnooze, /**btnRecur, *txtRecur,*/ *btnInfo, *enableSwitch;
lv_obj_t *trackerToggleBtn, *trackerToggleLabel;
lv_obj_t* lblampm = nullptr;
lv_obj_t* txtMessage = nullptr;
Expand Down

0 comments on commit 0e0e1f5

Please sign in to comment.