1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 01:05:10 +03:00

Fixes #2382: Vario only showing positive values

This commit is contained in:
Damjan Adamic 2015-06-25 19:45:05 +02:00
parent 2f2b5e2ebe
commit a88cace888

View file

@ -600,9 +600,11 @@ int32_t TelemetrySensor::getValue(int32_t value, uint8_t unit, uint8_t prec) con
if (type == TELEM_TYPE_CUSTOM) {
value += custom.offset;
if (value < 0 && unit >= UNIT_VOLTS && unit <= UNIT_MPH) {
value = 0;
// allow negative value for Vario VSPEED
if (id < VARIO_FIRST_ID && id > VARIO_LAST_ID) {
value = 0;
}
}
}
return value;