1
0
Fork 0
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:
Damjan Adamic 2015-06-26 21:35:09 +02:00 committed by bsongis
parent add90b3a88
commit 7312bd2655
17 changed files with 72 additions and 46 deletions

View file

@ -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;