aod: fix brightness getting stuck high

This commit is contained in:
mark9064 2023-10-14 16:02:23 -06:00 committed by JF
parent 0960d67001
commit 947c4f5067
3 changed files with 9 additions and 9 deletions

View file

@ -238,9 +238,6 @@ void DisplayApp::Refresh() {
case Messages::DimScreen: case Messages::DimScreen:
DimScreen(); DimScreen();
break; break;
case Messages::RestoreBrightness:
RestoreBrightness();
break;
case Messages::GoToSleep: case Messages::GoToSleep:
while (brightnessController.Level() != Controllers::BrightnessController::Levels::Low) { while (brightnessController.Level() != Controllers::BrightnessController::Levels::Low) {
brightnessController.Lower(); brightnessController.Lower();
@ -257,6 +254,9 @@ void DisplayApp::Refresh() {
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping); PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
state = States::Idle; state = States::Idle;
break; break;
case Messages::NotifyDeviceActivity:
lv_disp_trig_activity(nullptr);
break;
case Messages::GoToRunning: case Messages::GoToRunning:
if (settingsController.GetAlwaysOnDisplay()) { if (settingsController.GetAlwaysOnDisplay()) {
lcd.LowPowerOff(); lcd.LowPowerOff();

View file

@ -18,7 +18,7 @@ namespace Pinetime {
TimerDone, TimerDone,
BleFirmwareUpdateStarted, BleFirmwareUpdateStarted,
DimScreen, DimScreen,
RestoreBrightness, NotifyDeviceActivity,
ShowPairingKey, ShowPairingKey,
AlarmTriggered, AlarmTriggered,
Chime, Chime,

View file

@ -194,7 +194,7 @@ void SystemTask::Work() {
if (!bleController.IsFirmwareUpdating()) { if (!bleController.IsFirmwareUpdating()) {
doNotGoToSleep = false; doNotGoToSleep = false;
} }
displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
break; break;
case Messages::DisableSleeping: case Messages::DisableSleeping:
doNotGoToSleep = true; doNotGoToSleep = true;
@ -245,7 +245,7 @@ void SystemTask::Work() {
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep); heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
break; break;
case Messages::OnNewTime: case Messages::OnNewTime:
displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime); displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime);
if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) { if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) {
alarmController.ScheduleAlarm(); alarmController.ScheduleAlarm();
@ -256,7 +256,7 @@ void SystemTask::Work() {
if (state == SystemTaskState::Sleeping) { if (state == SystemTaskState::Sleeping) {
GoToRunning(); GoToRunning();
} else { } else {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
} }
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification); displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
} }
@ -268,7 +268,7 @@ void SystemTask::Work() {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered); displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered);
break; break;
case Messages::BleConnected: case Messages::BleConnected:
displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
isBleDiscoveryTimerRunning = true; isBleDiscoveryTimerRunning = true;
bleDiscoveryTimer = 5; bleDiscoveryTimer = 5;
break; break;
@ -466,7 +466,7 @@ void SystemTask::HandleButtonAction(Controllers::ButtonActions action) {
return; return;
} }
displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness); displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
using Actions = Controllers::ButtonActions; using Actions = Controllers::ButtonActions;