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

Fixed USE_VARIO conditional. (#8133)

Fixed USE_VARIO conditional.
This commit is contained in:
Michael Keller 2019-05-04 15:34:44 +12:00 committed by GitHub
commit ad2b350920
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -119,19 +119,19 @@ void calculateEstimatedAltitude(timeUs_t currentTimeUs)
#endif #endif
#ifdef USE_GPS #ifdef USE_GPS
if (sensors(SENSOR_GPS) && STATE(GPS_FIX)) { if (sensors(SENSOR_GPS) && STATE(GPS_FIX)) {
gpsAlt = gpsSol.llh.altCm; gpsAlt = gpsSol.llh.altCm;
#ifdef USE_VARIO #ifdef USE_VARIO
gpsVertSpeed = GPS_verticalSpeedInCmS; gpsVertSpeed = GPS_verticalSpeedInCmS;
#endif #endif
haveGpsAlt = true; haveGpsAlt = true;
if (gpsSol.hdop != 0) { if (gpsSol.hdop != 0) {
gpsTrust = 100.0 / gpsSol.hdop; gpsTrust = 100.0 / gpsSol.hdop;
}
// always use at least 10% of other sources besides gps if available
gpsTrust = MIN(gpsTrust, 0.9f);
} }
// always use at least 10% of other sources besides gps if available
gpsTrust = MIN(gpsTrust, 0.9f);
}
#endif #endif
if (ARMING_FLAG(ARMED) && !altitudeOffsetSet) { if (ARMING_FLAG(ARMED) && !altitudeOffsetSet) {

View file

@ -60,7 +60,7 @@
#endif #endif
#endif #endif
#if !defined(USE_BARO) && !defined(USE_GPS) #if !defined(USE_BARO)
#undef USE_VARIO #undef USE_VARIO
#endif #endif