1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Reworked altitude estimation. Made it work when ACC is disabled.

This commit is contained in:
mikeller 2017-03-29 02:01:09 +13:00
parent 9053feb418
commit 6a03b48e7f
21 changed files with 127 additions and 135 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;
}
@ -619,7 +619,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)
@ -699,8 +699,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();
}
static void osdGetBlackboxStatusString(char * buff, uint8_t len)