From 5b3e1288a2d5d9637654f51a25cf8b6d66a0b229 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 6 Jan 2023 09:12:30 +0100 Subject: [PATCH] LUA trimSource is now a positive value --- radio/src/lua/api_model.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 9b8df5507..b83009cc1 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -531,8 +531,8 @@ Return input data for given input and line number * `switch` (number) input switch index * `curveType` (number) curve type (function, expo, custom curve) * `curveValue` (number) curve index - * `carryTrim` deprecated, please use trimSource instead - * 'trimSource' (number) a NEGATIVE number representing trim source + * `carryTrim` deprecated, please use trimSource instead. WARNING: carryTrim was getting negative values (carryTrim = - trimSource) + * 'trimSource' (number) a positive number representing trim source * '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, carryTrim replaced by trimSource in 2.3.16 @@ -555,7 +555,7 @@ static int luaModelGetInput(lua_State *L) lua_pushtableinteger(L, "curveType", expo->curve.type); lua_pushtableinteger(L, "curveValue", expo->curve.value); lua_pushtableinteger(L, "carryTrim", expo->trimSource); - lua_pushtableinteger(L, "trimSource", expo->trimSource); + lua_pushtableinteger(L, "trimSource", - expo->trimSource); lua_pushtableinteger(L, "flightModes", expo->flightModes); } else { @@ -624,7 +624,7 @@ static int luaModelInsertInput(lua_State *L) expo->trimSource = luaL_checkinteger(L, -1); } else if (!strcmp(key, "trimSource")) { - expo->trimSource = luaL_checkinteger(L, -1); + expo->trimSource = - luaL_checkinteger(L, -1); } else if (!strcmp(key, "flightModes")) { expo->flightModes = luaL_checkinteger(L, -1);