summaryrefslogtreecommitdiff
path: root/src/ui/ui_fsm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui_fsm.cpp')
-rw-r--r--src/ui/ui_fsm.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp
index a9d130ed..b08722aa 100644
--- a/src/ui/ui_fsm.cpp
+++ b/src/ui/ui_fsm.cpp
@@ -7,6 +7,9 @@
#include "ui_fsm.hpp"
#include "display.hpp"
#include "lvgl_task.hpp"
+#include "screen.hpp"
+#include "screen_menu.hpp"
+#include "screen_splash.hpp"
#include "system_events.hpp"
#include "touchwheel.hpp"
@@ -17,6 +20,8 @@ std::weak_ptr<drivers::TouchWheel> UiState::sTouchWheel;
std::weak_ptr<drivers::Display> UiState::sDisplay;
std::weak_ptr<database::Database> UiState::sDatabase;
+std::shared_ptr<Screen> UiState::sCurrentScreen;
+
auto UiState::Init(drivers::GpioExpander* gpio_expander,
std::weak_ptr<drivers::TouchWheel> touchwheel,
std::weak_ptr<drivers::Display> display,
@@ -33,10 +38,18 @@ void PreBoot::react(const system_fsm::DisplayReady& ev) {
transit<Splash>([&]() { StartLvgl(sTouchWheel, sDisplay); });
}
+void Splash::entry() {
+ sCurrentScreen.reset(new screens::Splash());
+}
+
void Splash::react(const system_fsm::BootComplete& ev) {
transit<Interactive>();
}
+void Interactive::entry() {
+ // sCurrentScreen.reset(new screens::Menu());
+}
+
} // namespace states
} // namespace ui