1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 09:45:37 +03:00

Merge pull request #2760 from mikeller/reworked_altitude_estimation

Reworked altitude estimation. Made it work when ACC is disabled.
This commit is contained in:
Michael Keller 2017-04-10 13:00:16 +12:00 committed by GitHub
commit ce8c5fbd79
21 changed files with 127 additions and 136 deletions

View file

@ -256,7 +256,7 @@ static void osdDrawSingleElement(uint8_t item)
case OSD_ALTITUDE:
{
int32_t alt = osdGetAltitude(baro.BaroAlt);
int32_t alt = osdGetAltitude(getEstimatedAltitude());
sprintf(buff, "%c%d.%01d%c", alt < 0 ? '-' : ' ', abs(alt / 100), abs((alt % 100) / 10), osdGetAltitudeSymbol());
break;
}
@ -620,7 +620,7 @@ void osdUpdateAlarms(void)
// This is overdone?
// uint16_t *itemPos = osdConfig()->item_pos;
int32_t alt = osdGetAltitude(baro.BaroAlt) / 100;
int32_t alt = osdGetAltitude(getEstimatedAltitude()) / 100;
statRssi = rssi * 100 / 1024;
if (statRssi < osdConfig()->rssi_alarm)
@ -700,8 +700,8 @@ static void osdUpdateStats(void)
if (stats.min_rssi > statRssi)
stats.min_rssi = statRssi;
if (stats.max_altitude < baro.BaroAlt)
stats.max_altitude = baro.BaroAlt;
if (stats.max_altitude < getEstimatedAltitude())
stats.max_altitude = getEstimatedAltitude();
}
#ifdef BLACKBOX