From db9e5cce1fff82149a609939709a94ae02f349a8 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 22 Apr 2024 16:00:53 +1000 Subject: Improve handling of the display - Blank the display when locking to prevent burn-in - Delay turning the display on until *exactly* after the first lvgl flush - Init the display in the ui task to avoid blocking the rest of boot --- src/ui/include/ui_events.hpp | 7 +++++++ src/ui/include/ui_fsm.hpp | 1 + 2 files changed, 8 insertions(+) (limited to 'src/ui/include') diff --git a/src/ui/include/ui_events.hpp b/src/ui/include/ui_events.hpp index 81e0543a..3d794edc 100644 --- a/src/ui/include/ui_events.hpp +++ b/src/ui/include/ui_events.hpp @@ -8,7 +8,9 @@ #include #include "database.hpp" +#include "gpios.hpp" #include "index.hpp" +#include "nvs.hpp" #include "screen.hpp" #include "tinyfsm.hpp" @@ -32,6 +34,11 @@ struct DumpLuaStack : tinyfsm::Event {}; namespace internal { +struct InitDisplay : tinyfsm::Event { + drivers::IGpios& gpios; + drivers::NvsStorage& nvs; +}; + struct ReindexDatabase : tinyfsm::Event {}; struct BackPressed : tinyfsm::Event {}; diff --git a/src/ui/include/ui_fsm.hpp b/src/ui/include/ui_fsm.hpp index 8eafc6e0..325aea8f 100644 --- a/src/ui/include/ui_fsm.hpp +++ b/src/ui/include/ui_fsm.hpp @@ -70,6 +70,7 @@ class UiState : public tinyfsm::Fsm { void react(const system_fsm::KeyLockChanged&); void react(const system_fsm::SamdUsbStatusChanged&); + void react(const internal::InitDisplay&); void react(const internal::DismissAlerts&); void react(const database::event::UpdateStarted&); -- cgit v1.2.3