From 947c4f5067615fea540e2859c0c0127f2a3ce495 Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Sat, 14 Oct 2023 16:02:23 -0600 Subject: [PATCH] aod: fix brightness getting stuck high --- src/displayapp/DisplayApp.cpp | 6 +++--- src/displayapp/Messages.h | 2 +- src/systemtask/SystemTask.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 1a579cb1..6fda99db 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -238,9 +238,6 @@ void DisplayApp::Refresh() { case Messages::DimScreen: DimScreen(); break; - case Messages::RestoreBrightness: - RestoreBrightness(); - break; case Messages::GoToSleep: while (brightnessController.Level() != Controllers::BrightnessController::Levels::Low) { brightnessController.Lower(); @@ -257,6 +254,9 @@ void DisplayApp::Refresh() { PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping); state = States::Idle; break; + case Messages::NotifyDeviceActivity: + lv_disp_trig_activity(nullptr); + break; case Messages::GoToRunning: if (settingsController.GetAlwaysOnDisplay()) { lcd.LowPowerOff(); diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index dada3088..1418f6be 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -18,7 +18,7 @@ namespace Pinetime { TimerDone, BleFirmwareUpdateStarted, DimScreen, - RestoreBrightness, + NotifyDeviceActivity, ShowPairingKey, AlarmTriggered, Chime, diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 5bd71c38..211e19ec 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -194,7 +194,7 @@ void SystemTask::Work() { if (!bleController.IsFirmwareUpdating()) { doNotGoToSleep = false; } - displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); + displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity); break; case Messages::DisableSleeping: doNotGoToSleep = true; @@ -245,7 +245,7 @@ void SystemTask::Work() { heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep); break; case Messages::OnNewTime: - displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); + displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity); displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime); if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) { alarmController.ScheduleAlarm(); @@ -256,7 +256,7 @@ void SystemTask::Work() { if (state == SystemTaskState::Sleeping) { GoToRunning(); } else { - displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); + displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity); } displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification); } @@ -268,7 +268,7 @@ void SystemTask::Work() { displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered); break; case Messages::BleConnected: - displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); + displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity); isBleDiscoveryTimerRunning = true; bleDiscoveryTimer = 5; break; @@ -466,7 +466,7 @@ void SystemTask::HandleButtonAction(Controllers::ButtonActions action) { return; } - displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); + displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity); using Actions = Controllers::ButtonActions;