summaryrefslogtreecommitdiff
path: root/src/ui/include/ui_fsm.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-06-07 10:30:33 +1000
committerjacqueline <me@jacqueline.id.au>2023-06-07 10:30:33 +1000
commit2a568846bd8f1c9e23e86e7570557eed6f18cf9f (patch)
tree3c152311311233eda762bb8b441ad44b50800cb8 /src/ui/include/ui_fsm.hpp
parent610991455d335663de1dd6c0c6a3e0247ffd46df (diff)
downloadtangara-fw-2a568846bd8f1c9e23e86e7570557eed6f18cf9f.tar.gz
Cute brightness fade to avoid ugly startup :)
Diffstat (limited to 'src/ui/include/ui_fsm.hpp')
-rw-r--r--src/ui/include/ui_fsm.hpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/ui/include/ui_fsm.hpp b/src/ui/include/ui_fsm.hpp
index da6263b7..8b80f162 100644
--- a/src/ui/include/ui_fsm.hpp
+++ b/src/ui/include/ui_fsm.hpp
@@ -21,9 +21,7 @@ namespace ui {
class UiState : public tinyfsm::Fsm<UiState> {
public:
- static auto Init(drivers::GpioExpander* gpio_expander,
- const std::weak_ptr<drivers::RelativeWheel>& touchwheel,
- const std::weak_ptr<drivers::Display>& display) -> void;
+ static auto Init(drivers::GpioExpander* gpio_expander) -> bool;
virtual ~UiState() {}
@@ -42,23 +40,18 @@ class UiState : public tinyfsm::Fsm<UiState> {
protected:
static drivers::GpioExpander* sGpioExpander;
- static std::weak_ptr<drivers::RelativeWheel> sTouchWheel;
- static std::weak_ptr<drivers::Display> sDisplay;
+ static std::shared_ptr<drivers::TouchWheel> sTouchWheel;
+ static std::shared_ptr<drivers::RelativeWheel> sRelativeWheel;
+ static std::shared_ptr<drivers::Display> sDisplay;
static std::shared_ptr<Screen> sCurrentScreen;
};
namespace states {
-class PreBoot : public UiState {
- public:
- void react(const system_fsm::DisplayReady&) override;
- using UiState::react;
-};
-
class Splash : public UiState {
public:
- void entry() override;
+ void exit() override;
void react(const system_fsm::BootComplete&) override;
using UiState::react;
};