diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-30 17:05:11 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-30 17:05:11 +1000 |
| commit | 0347555d5b2314e1be58261ef29fa13a76c039e6 (patch) | |
| tree | e38879c0dc8bbf0a58057d22b26f28c0a9b86e93 /src/ui | |
| parent | 9763cc955c4f3b2c2af54b61c2c5ad77afef9603 (diff) | |
| download | tangara-fw-0347555d5b2314e1be58261ef29fa13a76c039e6.tar.gz | |
Start on converting gpio expander interupts to fsm events
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/include/ui_fsm.hpp | 4 | ||||
| -rw-r--r-- | src/ui/ui_fsm.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/include/ui_fsm.hpp b/src/ui/include/ui_fsm.hpp index 8b80f162..d0bb7b2f 100644 --- a/src/ui/include/ui_fsm.hpp +++ b/src/ui/include/ui_fsm.hpp @@ -35,6 +35,8 @@ class UiState : public tinyfsm::Fsm<UiState> { /* Fallback event handler. Does nothing. */ void react(const tinyfsm::Event& ev) {} + virtual void react(const system_fsm::KeyLockChanged&){}; + virtual void react(const system_fsm::DisplayReady&) {} virtual void react(const system_fsm::BootComplete&) {} @@ -58,6 +60,8 @@ class Splash : public UiState { class Interactive : public UiState { void entry() override; + + void react(const system_fsm::KeyLockChanged&) override; }; class FatalError : public UiState {}; diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp index bdc1f89f..c2ac6d8b 100644 --- a/src/ui/ui_fsm.cpp +++ b/src/ui/ui_fsm.cpp @@ -68,6 +68,10 @@ void Interactive::entry() { sCurrentScreen.reset(new screens::Menu()); } +void Interactive::react(const system_fsm::KeyLockChanged& ev) { + sDisplay->SetDisplayOn(ev.falling); +} + } // namespace states } // namespace ui |
