mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Fixes #2382: new atribute onlyPositive for telemetry sensor
Conflicts: radio/src/translations/it.h.txt
This commit is contained in:
parent
add90b3a88
commit
7312bd2655
17 changed files with 72 additions and 46 deletions
|
@ -599,10 +599,9 @@ 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) {
|
||||
if (value < 0 && onlyPositive) {
|
||||
value = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue