Skip to content

Commit

Permalink
fix(color): Value widget not refreshing when telem lost (EdgeTX#4223)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick authored and MRC3742 committed Dec 22, 2023
1 parent 7227bf9 commit 5b1db17
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion radio/src/gui/colorlcd/widgets/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,21 @@ class ValueWidget: public Widget
{
Widget::checkEvents();

auto newValue = getValue(persistentData->options[0].value.unsignedValue);
mixsrc_t field = persistentData->options[0].value.unsignedValue;

// if value changed
auto newValue = getValue(field);
if (lastValue != newValue) {
lastValue = newValue;
invalidate();
}

// if telemetry value, and telemetry offline or old data
if (field >= MIXSRC_FIRST_TELEM) {
TelemetryItem& telemetryItem =
telemetryItems[(field - MIXSRC_FIRST_TELEM) / 3];
if (!telemetryItem.isAvailable() || telemetryItem.isOld()) invalidate();
}
}

static const ZoneOption options[];
Expand Down

0 comments on commit 5b1db17

Please sign in to comment.