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

Move check for valid GPS heading to a function

Allows calling it from both the IMU and the wind estimator
This commit is contained in:
Alberto García Hierro 2017-11-03 15:18:02 +00:00
parent c52f687ec5
commit 78e62d36a8
3 changed files with 8 additions and 1 deletions

View file

@ -463,7 +463,7 @@ static void imuCalculateEstimatedAttitude(float dT)
#if defined(USE_GPS)
if (STATE(FIXED_WING)) {
bool canUseCOG = sensors(SENSOR_GPS) && STATE(GPS_FIX) && gpsSol.numSat >= 6 && gpsSol.groundSpeed >= 300;
bool canUseCOG = isGPSHeadingValid();
if (canUseCOG) {
if (gpsHeadingInitialized) {