diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-04-24 16:06:10 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-04-24 16:06:10 +1000 |
| commit | 920345b940bb3993c389d9e9be1a75a8041d431d (patch) | |
| tree | 562e53906a14c31ba8a21b3c2ae64c652a16acb4 /src/ui/ui_fsm.cpp | |
| parent | 531475e3511e9c722677d3a351b51d4a579876df (diff) | |
| download | tangara-fw-920345b940bb3993c389d9e9be1a75a8041d431d.tar.gz | |
Support getting a tree of controls + hooks via lua
Diffstat (limited to 'src/ui/ui_fsm.cpp')
| -rw-r--r-- | src/ui/ui_fsm.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp index ceeb194d..1cbf1be4 100644 --- a/src/ui/ui_fsm.cpp +++ b/src/ui/ui_fsm.cpp @@ -14,6 +14,7 @@ #include "db_events.hpp" #include "device_factory.hpp" #include "display_init.hpp" +#include "esp_spp_api.h" #include "feedback_haptics.hpp" #include "freertos/portmacro.h" #include "freertos/projdefs.h" @@ -497,10 +498,13 @@ void Lua::entry() { {"brightness", &sDisplayBrightness}, }); - registry.AddPropertyModule("controls", { - {"scheme", &sInput->mode()}, - {"lock_switch", &sLockSwitch}, - }); + registry.AddPropertyModule( + "controls", + { + {"scheme", &sInput->mode()}, + {"lock_switch", &sLockSwitch}, + {"hooks", [&](lua_State* L) { return sInput->pushHooks(L); }}, + }); if (sDeviceFactory->touch_wheel()) { registry.AddPropertyModule( |
