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:
parent
2f2b5e2ebe
commit
a88cace888
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue