inactivity: Use LVGL inactivity timers

Replace custom FreeRTOS inactivity timers with LVGL inactivity timers.

DisplayApp: Trigger display activity on timer done.

inactivity: Add additional checks
The backlight could be turned on by RestoreBrightness() on ble connect
event.

inactivity: Trigger activity on screen switch

A notification timing out could put the watch to sleep immediately.
While this could be ideal behaviour, it was caused by delay in
processing the EnableSleeping event and pushing RestoreBrightness to
DisplayApp.
This commit is contained in:
Riku Isokoski
2023-02-21 23:30:43 +02:00
parent 11ade64166
commit 310ea81eec
7 changed files with 52 additions and 76 deletions

View File

@@ -84,6 +84,10 @@ namespace Pinetime {
void OnIdle();
void OnDim();
bool IsSleepDisabled() {
return doNotGoToSleep;
}
Pinetime::Controllers::NimbleController& nimble() {
return nimbleController;
};
@@ -123,14 +127,10 @@ namespace Pinetime {
static void Process(void* instance);
void Work();
void ReloadIdleTimer();
bool isBleDiscoveryTimerRunning = false;
uint8_t bleDiscoveryTimer = 0;
TimerHandle_t dimTimer;
TimerHandle_t idleTimer;
TimerHandle_t measureBatteryTimer;
bool doNotGoToSleep = false;
bool isDimmed = false;
SystemTaskState state = SystemTaskState::Running;
void HandleButtonAction(Controllers::ButtonActions action);