From d2e5d2ab3cff0723cd995b0fca62aeb2a681d32d Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 6 Jun 2023 11:49:41 +1000 Subject: Fix up screen brightness and transitions --- src/ui/ui_fsm.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/ui/ui_fsm.cpp') diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp index 6d53eb45..1bc7ddb8 100644 --- a/src/ui/ui_fsm.cpp +++ b/src/ui/ui_fsm.cpp @@ -23,12 +23,16 @@ std::weak_ptr UiState::sDisplay; std::shared_ptr UiState::sCurrentScreen; auto UiState::Init(drivers::GpioExpander* gpio_expander, - std::weak_ptr touchwheel, - std::weak_ptr display) -> void { + const std::weak_ptr& touchwheel, + const std::weak_ptr& display) -> void { + assert(!touchwheel.expired()); + assert(!display.expired()); sGpioExpander = gpio_expander; sTouchWheel = touchwheel; sDisplay = display; + sCurrentScreen.reset(new screens::Splash()); + StartLvgl(sTouchWheel, sDisplay); } @@ -39,7 +43,6 @@ void PreBoot::react(const system_fsm::DisplayReady& ev) { } void Splash::entry() { - sCurrentScreen.reset(new screens::Splash()); } void Splash::react(const system_fsm::BootComplete& ev) { @@ -47,7 +50,7 @@ void Splash::react(const system_fsm::BootComplete& ev) { } void Interactive::entry() { - // sCurrentScreen.reset(new screens::Menu()); + sCurrentScreen.reset(new screens::Menu()); } } // namespace states -- cgit v1.2.3