fix: Disable LUA GV funcs if GVARS=NO build (#1645)

Compile option breakage from #1602
This commit is contained in:
Peter Feerick
2022-03-01 08:38:20 +10:00
committed by GitHub
parent 0e412000b9
commit 2929f1aca9
+4
View File
@@ -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 */