mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
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:
parent
a1d44d4d9f
commit
f854442c79
4 changed files with 12 additions and 12 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue