X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fkernel%2Fao_flight.c;h=cb02c4549ee20564981f8fafa7c2072b1bdd1b65;hb=f0068719b17019c5cd7ed318364a0581caf64e1a;hp=b0d911ed7f2663ac5b820cc0146d4944da9d2d85;hpb=cf20e213f39fb24f15e0ac94307c2d138fcadecb;p=fw%2Faltos diff --git a/src/kernel/ao_flight.c b/src/kernel/ao_flight.c index b0d911ed..cb02c454 100644 --- a/src/kernel/ao_flight.c +++ b/src/kernel/ao_flight.c @@ -21,7 +21,7 @@ #include #endif -#if HAS_MPU6000 +#if HAS_MPU6000 || HAS_MPU9250 #include #endif @@ -282,9 +282,11 @@ ao_flight(void) * the measured altitude reasonably closely; otherwise * we're probably transsonic. */ +#define AO_ERROR_BOUND 100 + if (ao_speed < 0 #if !HAS_ACCEL - && (ao_sample_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < 100) + && (ao_sample_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < AO_ERROR_BOUND) #endif ) {