summaryrefslogtreecommitdiff
path: root/src/lua/lua_controls.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-05-02 19:12:26 +1000
committerjacqueline <me@jacqueline.id.au>2024-05-02 19:12:26 +1000
commit1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 (patch)
treed162822b8fd7054f81bace0c7a65ab4d5e6f93ef /src/lua/lua_controls.cpp
parenta231fd1c8afedbeb14b0bc77d76bad61db986059 (diff)
downloadtangara-fw-1573a8c4cde1cd9528b422b2dcc598e37ffe94a7.tar.gz
WIP merge cyclically dependent components into one big component
Diffstat (limited to 'src/lua/lua_controls.cpp')
-rw-r--r--src/lua/lua_controls.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/lua/lua_controls.cpp b/src/lua/lua_controls.cpp
deleted file mode 100644
index 2da0ed11..00000000
--- a/src/lua/lua_controls.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2023 jacqueline <me@jacqueline.id.au>
- *
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-#include "lua_controls.hpp"
-
-#include <memory>
-#include <string>
-
-#include "lua.hpp"
-
-#include "esp_log.h"
-#include "lauxlib.h"
-#include "lua.h"
-#include "lvgl.h"
-
-#include "nvs.hpp"
-#include "ui_events.hpp"
-
-namespace lua {
-
-[[maybe_unused]] static constexpr char kTag[] = "lua_controls";
-
-static auto controls_schemes(lua_State* L) -> int {
- lua_newtable(L);
-
- lua_pushliteral(L, "Buttons Only");
- lua_rawseti(L, -2,
- static_cast<int>(drivers::NvsStorage::InputModes::kButtonsOnly));
-
- lua_pushliteral(L, "D-Pad");
- lua_rawseti(
- L, -2,
- static_cast<int>(drivers::NvsStorage::InputModes::kDirectionalWheel));
-
- lua_pushliteral(L, "Touchwheel");
- lua_rawseti(
- L, -2, static_cast<int>(drivers::NvsStorage::InputModes::kRotatingWheel));
-
- return 1;
-}
-
-static const struct luaL_Reg kControlsFuncs[] = {{"schemes", controls_schemes},
- {NULL, NULL}};
-
-static auto lua_controls(lua_State* state) -> int {
- luaL_newlib(state, kControlsFuncs);
- return 1;
-}
-
-auto RegisterControlsModule(lua_State* s) -> void {
- luaL_requiref(s, "controls", lua_controls, true);
- lua_pop(s, 1);
-}
-
-} // namespace lua