fix(lua): curve value incorrect in model.getInput and model.insertInput API calls (#6357)

This commit is contained in:
philmoz
2025-06-13 11:07:14 +10:00
committed by GitHub
parent 8ed3374bcc
commit bca6dc076e
3 changed files with 5 additions and 17 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ inline uint16_t makeSourceNumVal(int16_t val, bool isSource = false)
PACK(struct CurveRef {
uint16_t type:5;
int16_t value:11 CUST(r_sourceNumVal,w_sourceNumVal);
uint16_t value:11 CUST(r_sourceNumVal,w_sourceNumVal);
});
PACK(struct MixData {
+1 -1
View File
@@ -147,7 +147,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlag
drawCurveName(x, y, v.value, flags);
if (active && menuHorizontalPosition == 1) {
if (event == EVT_KEY_LONG(KEY_ENTER) && v.value != 0) {
s_currIdxSubMenu = abs(curve.value) - 1;
s_currIdxSubMenu = abs(v.value) - 1;
pushMenu(menuModelCurveOne);
}
else {
+3 -15
View File
@@ -680,18 +680,10 @@ static int luaModelInsertInput(lua_State *L)
expo->mode = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "weight")) {
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
expo->weight = v.rawValue;
expo->weight = luaL_checkunsigned(L, -1);
}
else if (!strcmp(key, "offset")) {
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
expo->offset = v.rawValue;
expo->offset = luaL_checkunsigned(L, -1);
}
else if (!strcmp(key, "switch")) {
expo->swtch = luaL_checkinteger(L, -1);
@@ -700,11 +692,7 @@ static int luaModelInsertInput(lua_State *L)
expo->curve.type = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "curveValue")) {
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
expo->curve.value = v.rawValue;
expo->curve.value = luaL_checkunsigned(L, -1);
}
else if (!strcmp(key, "trimSource")) {
expo->trimSource = - luaL_checkinteger(L, -1);