fix(bw): unable to select GV as source for weight/offset/curve in input/mix (#5386)
This commit is contained in:
@@ -92,7 +92,7 @@ swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr,
|
||||
|
||||
uint16_t editSrcVarFieldValue(coord_t x, coord_t y, const char* title, uint16_t value,
|
||||
int16_t min, int16_t max, LcdFlags attr, event_t event,
|
||||
IsValueAvailable isValueAvailable, int16_t sourceMin);
|
||||
IsValueAvailable isValueAvailable, int16_t sourceMin, int16_t sourceMax);
|
||||
|
||||
#if defined(GVARS)
|
||||
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value,
|
||||
@@ -121,7 +121,7 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min,
|
||||
#endif
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags,
|
||||
IsValueAvailable isValueAvailable, int16_t sourceMin);
|
||||
IsValueAvailable isValueAvailable, int16_t sourceMin, int16_t sourceMax);
|
||||
|
||||
extern uint8_t editNameCursorPos;
|
||||
|
||||
|
||||
@@ -120,17 +120,17 @@ void menuModelExpoOne(event_t event)
|
||||
|
||||
case EXPO_FIELD_WEIGHT:
|
||||
ed->weight = editSrcVarFieldValue(EXPO_ONE_2ND_COLUMN, y, STR_WEIGHT, ed->weight,
|
||||
-100, 100, attr, event, isSourceAvailableInInputs, INPUTSRC_FIRST);
|
||||
-100, 100, attr, event, isSourceAvailableInInputs, INPUTSRC_FIRST, INPUTSRC_LAST);
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_OFFSET:
|
||||
ed->offset = editSrcVarFieldValue(EXPO_ONE_2ND_COLUMN, y, STR_OFFSET, ed->offset,
|
||||
-100, 100, attr, event, isSourceAvailableInInputs, INPUTSRC_FIRST);
|
||||
-100, 100, attr, event, isSourceAvailableInInputs, INPUTSRC_FIRST, INPUTSRC_LAST);
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_CURVE:
|
||||
lcdDrawTextAlignedLeft(y, STR_CURVE);
|
||||
editCurveRef(EXPO_ONE_2ND_COLUMN, y, ed->curve, event, attr, isSourceAvailableInInputs, INPUTSRC_FIRST);
|
||||
editCurveRef(EXPO_ONE_2ND_COLUMN, y, ed->curve, event, attr, isSourceAvailableInInputs, INPUTSRC_FIRST, INPUTSRC_LAST);
|
||||
break;
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
|
||||
@@ -134,12 +134,12 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
case MIX_FIELD_WEIGHT:
|
||||
md2->weight = editSrcVarFieldValue(MIXES_2ND_COLUMN, y, STR_WEIGHT, md2->weight,
|
||||
MIX_WEIGHT_MIN, MIX_WEIGHT_MAX, attr, event, isSourceAvailable, 1);
|
||||
MIX_WEIGHT_MIN, MIX_WEIGHT_MAX, attr, event, isSourceAvailable, 1, MIXSRC_LAST);
|
||||
break;
|
||||
|
||||
case MIX_FIELD_OFFSET:
|
||||
md2->offset = editSrcVarFieldValue(MIXES_2ND_COLUMN, y, STR_OFFSET, md2->offset,
|
||||
MIX_OFFSET_MIN, MIX_OFFSET_MAX, attr, event, isSourceAvailable, 1);
|
||||
MIX_OFFSET_MIN, MIX_OFFSET_MAX, attr, event, isSourceAvailable, 1, MIXSRC_LAST);
|
||||
drawOffsetBar(MIXES_2ND_COLUMN+35, y, md2);
|
||||
break;
|
||||
|
||||
@@ -155,7 +155,7 @@ void menuModelMixOne(event_t event)
|
||||
lcdDrawTextAlignedLeft(y, STR_CURVE);
|
||||
s_currSrcRaw = md2->srcRaw;
|
||||
s_currScale = 0;
|
||||
editCurveRef(MIXES_2ND_COLUMN, y, md2->curve, event, attr, isSourceAvailable, 1);
|
||||
editCurveRef(MIXES_2ND_COLUMN, y, md2->curve, event, attr, isSourceAvailable, 1, MIXSRC_LAST);
|
||||
break;
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
|
||||
@@ -122,7 +122,7 @@ void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
|
||||
uint16_t editSrcVarFieldValue(coord_t x, coord_t y, const char* title, uint16_t value,
|
||||
int16_t min, int16_t max, LcdFlags attr, event_t event,
|
||||
IsValueAvailable isValueAvailable, int16_t sourceMin)
|
||||
IsValueAvailable isValueAvailable, int16_t sourceMin, int16_t sourceMax)
|
||||
{
|
||||
if (title)
|
||||
lcdDrawTextAlignedLeft(y, title);
|
||||
@@ -131,14 +131,15 @@ uint16_t editSrcVarFieldValue(coord_t x, coord_t y, const char* title, uint16_t
|
||||
if (v.isSource) {
|
||||
drawSource(x, y, v.value, attr);
|
||||
if (attr & (~RIGHT)) {
|
||||
value = checkIncDec(event, value, sourceMin,
|
||||
MIXSRC_LAST, EE_MODEL|INCDEC_SOURCE|INCDEC_SOURCE_VALUE|INCDEC_SOURCE_INVERT|NO_INCDEC_MARKS, isValueAvailable);
|
||||
value = checkIncDec(event, value, sourceMin, sourceMax,
|
||||
EE_MODEL|INCDEC_SOURCE|INCDEC_SOURCE_VALUE|INCDEC_SOURCE_INVERT|NO_INCDEC_MARKS, isValueAvailable);
|
||||
}
|
||||
} else {
|
||||
lcdDrawNumber(x, y, v.value, attr);
|
||||
if (attr & (~RIGHT)) {
|
||||
value = checkIncDec(event, value, min, max,
|
||||
EE_MODEL|INCDEC_SOURCE_VALUE|NO_INCDEC_MARKS|(sourceMin == INPUTSRC_FIRST ? INCDEC_SOURCE_NOINPUTS : 0));
|
||||
value = checkIncDec(event, value, min, max, sourceMin, sourceMax,
|
||||
EE_MODEL|INCDEC_SOURCE_VALUE|NO_INCDEC_MARKS,
|
||||
isValueAvailable);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user