diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-06 11:49:41 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-06 11:49:41 +1000 |
| commit | d2e5d2ab3cff0723cd995b0fca62aeb2a681d32d (patch) | |
| tree | b3e0a9d1129917808876a4dd1d015b166ff425f4 /src/ui/ui_fsm.cpp | |
| parent | 8a2a2d226558d099243eea0aa9ae22b2791e0e0e (diff) | |
| download | tangara-fw-d2e5d2ab3cff0723cd995b0fca62aeb2a681d32d.tar.gz | |
Fix up screen brightness and transitions
Diffstat (limited to 'src/ui/ui_fsm.cpp')
| -rw-r--r-- | src/ui/ui_fsm.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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<drivers::Display> UiState::sDisplay; std::shared_ptr<Screen> UiState::sCurrentScreen; auto UiState::Init(drivers::GpioExpander* gpio_expander, - std::weak_ptr<drivers::RelativeWheel> touchwheel, - std::weak_ptr<drivers::Display> display) -> void { + const std::weak_ptr<drivers::RelativeWheel>& touchwheel, + const std::weak_ptr<drivers::Display>& 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 |
