Fixes #2531: VFAS id 0x39: was 10x to small

Fixes #2530: VFAS id 0x3A and 0x3B: wrong calculation of value
This commit is contained in:
Damjan Adamic
2015-07-21 21:43:02 +02:00
parent d2bd78b366
commit 6fffd7fbae
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -601,7 +601,7 @@ void processHubPacket(uint8_t id, int16_t value)
}
else if (id == VOLTS_AP_ID) {
if (lastId == VOLTS_BP_ID) {
data += lastValue * 100;
data = ((lastValue * 100 + value * 10) * 210) / 110;
unit = UNIT_VOLTS;
precision = 2;
}
@@ -639,6 +639,9 @@ void processHubPacket(uint8_t id, int16_t value)
if (id == RPM_ID) {
data = data * 60;
}
else if (id == VFAS_ID) {
data *= 10;
}
setTelemetryValue(TELEM_PROTO_FRSKY_D, id, 0, data, unit, precision);
}