Fixes #3047:
* negative altitude on top bar was displayed wrong (same bug affected vertical speed) * add ability to select an altitude sensor with ft unit for top bar * display actual sensor unit for top bar altitude
This commit is contained in:
@@ -647,14 +647,18 @@ bool TelemetrySensor::isPrecConfigurable() const
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t TelemetrySensor::getPrecMultiplier() const
|
||||
int32_t TelemetrySensor::getPrecMultiplier() const
|
||||
{
|
||||
/*
|
||||
Important: the return type must be signed, otherwise
|
||||
mathematic operations with a negative telemetry value won't work
|
||||
*/
|
||||
if (prec == 2) return 1;
|
||||
if (prec == 1) return 10;
|
||||
return 100;
|
||||
}
|
||||
|
||||
uint32_t TelemetrySensor::getPrecDivisor() const
|
||||
int32_t TelemetrySensor::getPrecDivisor() const
|
||||
{
|
||||
if (prec == 2) return 100;
|
||||
if (prec == 1) return 10;
|
||||
|
||||
Reference in New Issue
Block a user