Skip to content

Commit

Permalink
fix(lua): stick "side" missing from model.getInput (#5801)
Browse files Browse the repository at this point in the history
  • Loading branch information
forbesmyester authored Jan 21, 2025
1 parent c4646cf commit 9fb053a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion radio/src/lua/api_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,10 @@ Return input data for given input and line number
* `curveValue` (number) curve index
* `carryTrim` deprecated, please use trimSource instead. WARNING: carryTrim was getting negative values (carryTrim = - trimSource)
* 'trimSource' (number) a positive number representing trim source
* 'side' (number) input side (positive, negative or all)
* 'flightModes' (number) bit-mask of active flight modes
@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11, broken carryTrim replaced by trimSource in 2.8.1, scale added in 2.10
@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11, broken carryTrim replaced by trimSource in 2.8.1, scale added in 2.10, side added in 2.11
*/
static int luaModelGetInput(lua_State *L)
{
Expand All @@ -618,6 +619,7 @@ static int luaModelGetInput(lua_State *L)
lua_pushtableinteger(L, "curveType", expo->curve.type);
lua_pushtableinteger(L, "curveValue", expo->curve.value);
lua_pushtableinteger(L, "trimSource", - expo->trimSource);
lua_pushtableinteger(L, "side", expo->mode);
lua_pushtableinteger(L, "flightModes", expo->flightModes);
}
else {
Expand Down Expand Up @@ -674,6 +676,9 @@ static int luaModelInsertInput(lua_State *L)
else if (!strcmp(key, "scale")) {
expo->scale = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "side")) {
expo->mode = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "weight")) {
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
Expand Down

0 comments on commit 9fb053a

Please sign in to comment.