1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-12 19:10:19 +03:00

Fix assigning to the wrong member of the union

This commit is contained in:
Arne Schwabe 2016-06-13 20:05:53 +02:00
parent 06217c71a4
commit 25e6f25c54
3 changed files with 3 additions and 3 deletions

View file

@ -347,7 +347,7 @@ void menuModelSensor(uint8_t event)
else if (sensor->formula == TELEM_FORMULA_CONSTANT) {
lcd_putsLeft(y, STR_VALUE);
if (attr)
sensor->custom.offset = checkIncDec(event, sensor->constant.value, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
sensor->constant.value = checkIncDec(event, sensor->constant.value, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (sensor->prec > 0) attr |= (sensor->prec == 2 ? PREC2 : PREC1);
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->constant.value, LEFT|attr);
break;

View file

@ -261,7 +261,7 @@ bool menuModelSensor(evt_t event)
}
else if (sensor->formula == TELEM_FORMULA_CONSTANT) {
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_VALUE);
if (attr) sensor->custom.offset = checkIncDec(event, sensor->constant.value, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (attr) sensor->constant.value = checkIncDec(event, sensor->constant.value, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (sensor->prec > 0) attr |= (sensor->prec == 2 ? PREC2 : PREC1);
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->constant.value, LEFT|attr);
break;

View file

@ -258,7 +258,7 @@ void menuModelSensor(uint8_t event)
}
else if (sensor->formula == TELEM_FORMULA_CONSTANT) {
lcd_putsLeft(y, STR_VALUE);
if (attr) sensor->custom.offset = checkIncDec(event, sensor->constant.value, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (attr) sensor->constant.value = checkIncDec(event, sensor->constant.value, -30000, +30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
if (sensor->prec > 0) attr |= (sensor->prec == 2 ? PREC2 : PREC1);
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->constant.value, LEFT|attr);
break;