diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2025-01-17 02:23:42 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-01-17 02:23:42 +0000 |
| commit | 0180c9311db13281808976c2cc5e53994da4432f (patch) | |
| tree | 928f9eb4e8df35bbefa0f2dee05394a6a4fdec58 /src/tangara/input/lvgl_input_driver.cpp | |
| parent | 3dd0887c1f88570f041e9b18f5c1416a74fd028d (diff) | |
| parent | 6886c686d5b10ad8061e900aa0e7b326b0d5d04d (diff) | |
| download | tangara-fw-0180c9311db13281808976c2cc5e53994da4432f.tar.gz | |
Merge pull request 'Add an input sequence for hard rebooting' (#185) from jqln/hard-reset into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/185
Diffstat (limited to 'src/tangara/input/lvgl_input_driver.cpp')
| -rw-r--r-- | src/tangara/input/lvgl_input_driver.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/tangara/input/lvgl_input_driver.cpp b/src/tangara/input/lvgl_input_driver.cpp index 824e49cc..c008b007 100644 --- a/src/tangara/input/lvgl_input_driver.cpp +++ b/src/tangara/input/lvgl_input_driver.cpp @@ -114,11 +114,6 @@ auto LvglInputDriver::setGroup(lv_group_t* g) -> void { } auto LvglInputDriver::read(lv_indev_data_t* data) -> void { - // TODO: we should pass lock state on to the individual devices, since they - // may wish to either ignore the lock state, or power down until unlock. - if (is_locked_) { - return; - } for (auto&& device : inputs_) { device->read(data); } @@ -218,10 +213,17 @@ auto LvglInputDriver::pushHooks(lua_State* L) -> int { lua_newtable(L); for (auto& dev : inputs_) { + auto triggers = dev->triggers(); + if (triggers.empty()) { + // Some devices, e.g. hard reset, have no triggers. Don't include them + // in the hooks table. + continue; + } + lua_pushlstring(L, dev->name().data(), dev->name().size()); lua_newtable(L); - for (auto& trigger : dev->triggers()) { + for (auto& trigger : triggers) { lua_pushlstring(L, trigger.get().name().data(), trigger.get().name().size()); LuaTrigger** lua_obj = reinterpret_cast<LuaTrigger**>( |
