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:
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();

View file

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

View file

@ -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;