diff options
| author | ayumi <ayumi@noreply.codeberg.org> | 2025-02-15 02:25:27 +0100 |
|---|---|---|
| committer | ayumi <ayumi@noreply.codeberg.org> | 2025-03-05 08:57:46 +0100 |
| commit | 9fdf94e9cee5a5180ffefc2b8314f7a9879ebbc6 (patch) | |
| tree | 80c2ca8003fe32e59eccf2e208a53e1e87c66790 /src/tangara/ui | |
| parent | 42c2a4f2445ff56a2a0a78c4ef265e5be346d40d (diff) | |
| download | tangara-fw-9fdf94e9cee5a5180ffefc2b8314f7a9879ebbc6.tar.gz | |
Allow manually unmounting the SD card
Diffstat (limited to 'src/tangara/ui')
| -rw-r--r-- | src/tangara/ui/ui_fsm.cpp | 5 | ||||
| -rw-r--r-- | src/tangara/ui/ui_fsm.hpp | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/tangara/ui/ui_fsm.cpp b/src/tangara/ui/ui_fsm.cpp index a22c704b..ebc4b635 100644 --- a/src/tangara/ui/ui_fsm.cpp +++ b/src/tangara/ui/ui_fsm.cpp @@ -714,6 +714,11 @@ void Lua::entry() { }); registry.AddPropertyModule("sd_card", { {"mounted", &sSdMounted}, + {"unmount", [&](lua_State*) { + events::System().Dispatch( + UnmountRequest{}); + return 0; + }}, }); registry.AddPropertyModule("usb", { diff --git a/src/tangara/ui/ui_fsm.hpp b/src/tangara/ui/ui_fsm.hpp index aae69f94..d4354bec 100644 --- a/src/tangara/ui/ui_fsm.hpp +++ b/src/tangara/ui/ui_fsm.hpp @@ -37,6 +37,8 @@ namespace ui { +struct UnmountRequest : tinyfsm::Event {}; + class UiState : public tinyfsm::Fsm<UiState> { public: static auto InitBootSplash(drivers::IGpios&, drivers::NvsStorage&) -> bool; |
