From caa9cd30605bd10ddd125bba77bce8fb5896f6a0 Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Sat, 25 Nov 2017 14:56:49 -0500 Subject: [PATCH] [Companion] Telemetry screen bar range limits were unsigned (but are signed on ARM radios), didn't allow negative values. --- companion/src/firmwares/opentx/opentxeeprom.cpp | 8 ++++---- companion/src/radiodata.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index d5cca3eb3..bf6b80e33 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -2583,13 +2583,13 @@ class FrskyScreenField: public DataField { bars.Append(new SourceField<16>(this, screen.body.bars[i].source, board, version, variant)); else bars.Append(new SourceField<8>(this, screen.body.bars[i].source, board, version, variant)); - bars.Append(new UnsignedField<16>(this, screen.body.bars[i].barMin)); - bars.Append(new UnsignedField<16>(this, screen.body.bars[i].barMax)); + bars.Append(new SignedField<16>(this, screen.body.bars[i].barMin)); + bars.Append(new SignedField<16>(this, screen.body.bars[i].barMax)); } else { bars.Append(new TelemetrySourceField<8>(this, screen.body.bars[i].source, board, version)); - bars.Append(new UnsignedField<8>(this, screen.body.bars[i].barMin)); - bars.Append(new UnsignedField<8>(this, screen.body.bars[i].barMax)); + bars.Append(new UnsignedField<8>(this, (unsigned &)screen.body.bars[i].barMin)); + bars.Append(new UnsignedField<8>(this, (unsigned &)screen.body.bars[i].barMax)); } } diff --git a/companion/src/radiodata.h b/companion/src/radiodata.h index 4162ceafc..6911adb43 100644 --- a/companion/src/radiodata.h +++ b/companion/src/radiodata.h @@ -625,8 +625,8 @@ class FrSkyChannelData { struct FrSkyBarData { RawSource source; - unsigned int barMin; // minimum for bar display - unsigned int barMax; // ditto for max display (would usually = ratio) + int barMin; // minimum for bar display + int barMax; // ditto for max display (would usually = ratio) }; struct FrSkyLineData { -- 2.11.4.GIT