summaryrefslogtreecommitdiff
path: root/src/ui/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-05-24 13:30:05 +1000
committerjacqueline <me@jacqueline.id.au>2023-05-24 13:30:05 +1000
commit65833649f4779754e90760c1f0fc81ed220c84d0 (patch)
tree7aa4baa722edb7db80055fdeb9e8053766707259 /src/ui/include
parent3b371cfc544d4b7c462d0a32d06525ab2b970875 (diff)
downloadtangara-fw-65833649f4779754e90760c1f0fc81ed220c84d0.tar.gz
Add some placeholder splash and menu screens
Includes a bunch of misc display fixes. Most significantly, our lvgl tickers was busted.
Diffstat (limited to 'src/ui/include')
-rw-r--r--src/ui/include/ui_fsm.hpp18
1 files changed, 14 insertions, 4 deletions
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 <memory>
+#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<UiState> {
virtual ~UiState() {}
+ static auto current_screen() -> std::shared_ptr<Screen> {
+ return sCurrentScreen;
+ }
+
virtual void entry() {}
virtual void exit() {}
@@ -41,6 +46,8 @@ class UiState : public tinyfsm::Fsm<UiState> {
static std::weak_ptr<drivers::TouchWheel> sTouchWheel;
static std::weak_ptr<drivers::Display> sDisplay;
static std::weak_ptr<database::Database> sDatabase;
+
+ static std::shared_ptr<Screen> 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 {};