From 25e6f25c546b6d9916af7ed314b8ba99e729aa3d Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 13 Jun 2016 20:05:53 +0200 Subject: [PATCH] Fix assigning to the wrong member of the union --- radio/src/gui/9x/menu_model_telemetry.cpp | 2 +- radio/src/gui/horus/menu_model_telemetry.cpp | 2 +- radio/src/gui/taranis/menu_model_telemetry.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/9x/menu_model_telemetry.cpp b/radio/src/gui/9x/menu_model_telemetry.cpp index cbf10d26f..93a713127 100644 --- a/radio/src/gui/9x/menu_model_telemetry.cpp +++ b/radio/src/gui/9x/menu_model_telemetry.cpp @@ -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; diff --git a/radio/src/gui/horus/menu_model_telemetry.cpp b/radio/src/gui/horus/menu_model_telemetry.cpp index 53a8106b5..d80c86e4c 100644 --- a/radio/src/gui/horus/menu_model_telemetry.cpp +++ b/radio/src/gui/horus/menu_model_telemetry.cpp @@ -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; diff --git a/radio/src/gui/taranis/menu_model_telemetry.cpp b/radio/src/gui/taranis/menu_model_telemetry.cpp index 0a58c2a90..94264c8c0 100644 --- a/radio/src/gui/taranis/menu_model_telemetry.cpp +++ b/radio/src/gui/taranis/menu_model_telemetry.cpp @@ -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;