fix(firmware): range for V2 value may be incorrect for some logical switches (#7158)

This commit is contained in:
philmoz
2026-03-10 15:22:22 +10:00
committed by GitHub
parent 61f89b6076
commit 48e3b2ac7b
5 changed files with 30 additions and 24 deletions
@@ -227,13 +227,13 @@ void menuModelSensor(event_t event)
else {
if (sensor->unit == UNIT_RPMS) {
lcdDrawTextAlignedLeft(y, STR_BLADES);
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 1, 30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 1, MIXSRC_MAX_VALUE, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr);
break;
}
else {
lcdDrawTextAlignedLeft(y, STR_RATIO);
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 0, 30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 0, MIXSRC_MAX_VALUE, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (sensor->custom.ratio == 0) {
lcdDrawChar(SENSOR_2ND_COLUMN, y, '-', attr);
} else { // Ratio + Ratio Percent
@@ -265,13 +265,13 @@ void menuModelSensor(event_t event)
}
else if (sensor->unit == UNIT_RPMS) {
lcdDrawTextAlignedLeft(y, STR_MULTIPLIER);
if (attr) sensor->custom.offset = checkIncDec(event, sensor->custom.offset, 1, 30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (attr) sensor->custom.offset = checkIncDec(event, sensor->custom.offset, 1, MIXSRC_MAX_VALUE, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.offset, LEFT|attr);
break;
}
else {
lcdDrawTextAlignedLeft(y, STR_OFFSET);
if (attr) sensor->custom.offset = checkIncDec(event, sensor->custom.offset, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (attr) sensor->custom.offset = checkIncDec(event, sensor->custom.offset, -MIXSRC_MAX_VALUE, +MIXSRC_MAX_VALUE, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (sensor->prec > 0) attr |= (sensor->prec == 2 ? PREC2 : PREC1);
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.offset, LEFT|attr);
break;