From 65833649f4779754e90760c1f0fc81ed220c84d0 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 24 May 2023 13:30:05 +1000 Subject: Add some placeholder splash and menu screens Includes a bunch of misc display fixes. Most significantly, our lvgl tickers was busted. --- src/ui/include/ui_fsm.hpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/ui/include') diff --git a/src/ui/include/ui_fsm.hpp b/src/ui/include/ui_fsm.hpp index 4a51551b..2afcfa86 100644 --- a/src/ui/include/ui_fsm.hpp +++ b/src/ui/include/ui_fsm.hpp @@ -8,13 +8,14 @@ #include +#include "tinyfsm.hpp" + #include "database.hpp" #include "display.hpp" +#include "screen.hpp" #include "storage.hpp" -#include "tinyfsm.hpp" -#include "touchwheel.hpp" - #include "system_events.hpp" +#include "touchwheel.hpp" namespace ui { @@ -27,6 +28,10 @@ class UiState : public tinyfsm::Fsm { virtual ~UiState() {} + static auto current_screen() -> std::shared_ptr { + return sCurrentScreen; + } + virtual void entry() {} virtual void exit() {} @@ -41,6 +46,8 @@ class UiState : public tinyfsm::Fsm { static std::weak_ptr sTouchWheel; static std::weak_ptr sDisplay; static std::weak_ptr sDatabase; + + static std::shared_ptr sCurrentScreen; }; namespace states { @@ -53,11 +60,14 @@ class PreBoot : public UiState { class Splash : public UiState { public: + void entry() override; void react(const system_fsm::BootComplete&) override; using UiState::react; }; -class Interactive : public UiState {}; +class Interactive : public UiState { + void entry() override; +}; class FatalError : public UiState {}; -- cgit v1.2.3