From 0d7a486630b5f025fe4e90b9ab44078a55766be8 Mon Sep 17 00:00:00 2001 From: Bryan Mayland Date: Sun, 6 Jan 2019 05:01:11 -0500 Subject: [PATCH] Display FlySky VOLTS values as signed integers (#6252) Standard AFHDS2A protocol transmits all values as 2 raw bytes and a stock FS-i6 transmitter shows voltage type values properly as signed. This change interprets all UNIT_VOLTS FlySky telemetry items as being signed 16-bit values so their display matches the values displayed on stock FS-i6 and FS-i6X receivers. Signed-off-by: Bryan Mayland --- radio/src/telemetry/flysky_ibus.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/telemetry/flysky_ibus.cpp b/radio/src/telemetry/flysky_ibus.cpp index 7f54c6594..980b158ce 100644 --- a/radio/src/telemetry/flysky_ibus.cpp +++ b/radio/src/telemetry/flysky_ibus.cpp @@ -103,6 +103,9 @@ static void processFlySkySensor(const uint8_t *packet) else if (id == FS_ID_TEMP) // Temperature sensors have 40 degree offset value -= 400; + else if (sensor->unit == UNIT_VOLTS) + // Voltage types are signed 16bit integers + value = (int16_t)value; setTelemetryValue(TELEM_PROTO_FLYSKY_IBUS, id, 0, instance, value, sensor->unit, sensor->precision); return; }