From 2929f1aca91ff6cbe36bb91101478f651a2c9a57 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 1 Mar 2022 08:38:20 +1000 Subject: [PATCH] fix: Disable LUA GV funcs if `GVARS=NO` build (#1645) Compile option breakage from #1602 --- radio/src/lua/api_model.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 4644b6ee5..cab38373d 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -1487,6 +1487,7 @@ static int luaModelSetOutput(lua_State *L) return 0; } +#if defined(GVARS) /*luadoc @function model.getGlobalVariable(index, flight_mode) @@ -1547,6 +1548,7 @@ static int luaModelSetGlobalVariable(lua_State *L) } return 0; } +#endif /*luadoc @function model.getSensor(sensor) @@ -1644,8 +1646,10 @@ const luaL_Reg modelLib[] = { { "setCurve", luaModelSetCurve }, { "getOutput", luaModelGetOutput }, { "setOutput", luaModelSetOutput }, +#if defined (GVARS) { "getGlobalVariable", luaModelGetGlobalVariable }, { "setGlobalVariable", luaModelSetGlobalVariable }, +#endif { "getSensor", luaModelGetSensor }, { "resetSensor", luaModelResetSensor }, { NULL, NULL } /* sentinel */