Fixes #2382: new atribute onlyPositive for telemetry sensor

Conflicts:
	radio/src/translations/it.h.txt
This commit is contained in:
Damjan Adamic
2015-06-28 12:37:55 +02:00
committed by bsongis
parent add90b3a88
commit 7312bd2655
17 changed files with 72 additions and 46 deletions
+1 -2
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;