Skip to content

Commit

Permalink
chore: remove useless editGVarFieldValue (#5221)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored Jun 27, 2024
1 parent cc42517 commit 1a736b7
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions radio/src/gui/128x64/widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,46 +208,6 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
}
return value;
}
#elif defined(GVARS)
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, event_t event)
{
uint16_t delta = GV_GET_GV1_VALUE(max);
bool invers = (attr & INVERS);

// TRACE("editGVarFieldValue(val=%d min=%d max=%d)", value, min, max);

if (invers && event == EVT_KEY_LONG(KEY_ENTER)) {
s_editMode = !s_editMode;
value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, mixerCurrentFlightMode) : delta);
storageDirty(EE_MODEL);
}
if (GV_IS_GV_VALUE(value, min, max)) {
if (attr & LEFT)
attr -= LEFT; /* because of ZCHAR */
else
x -= 2*FW+FWNUM;

int8_t idx = (int16_t) GV_INDEX_CALC_DELTA(value, delta);
if (invers) {
idx = checkIncDec(event, idx, -MAX_GVARS, MAX_GVARS-1, EE_MODEL|NO_DBLKEYS); // disable double keys
}
if (idx < 0) {
value = (int16_t) GV_CALC_VALUE_IDX_NEG(idx, delta);
idx = -idx;
lcdDrawChar(x-6, y, '-', attr);
}
else {
value = (int16_t) GV_CALC_VALUE_IDX_POS(idx, delta);
idx++;
}
drawStringWithIndex(x, y, STR_GV, idx, attr);
}
else {
lcdDrawNumber(x, y, value, attr);
if (invers) value = checkIncDec(event, value, min, max, EE_MODEL);
}
return value;
}
#else
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, event_t event)
{
Expand Down

0 comments on commit 1a736b7

Please sign in to comment.