From: Keith Packard Date: Sun, 11 Oct 2020 05:26:38 +0000 (-0700) Subject: altos: Use only accel for boost detect without baro X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=ab10b26a8299670db20618551fcc6a1a09bd34e8;p=fw%2Faltos altos: Use only accel for boost detect without baro Without baro, speed will integrate accel 'forever' and cause speed to be wildly inaccurate at boost time. Would be awesome to reset speed to zero at some point. Signed-off-by: Keith Packard --- diff --git a/src/kernel/ao_flight.c b/src/kernel/ao_flight.c index 4ffbcf4b..e895904c 100644 --- a/src/kernel/ao_flight.c +++ b/src/kernel/ao_flight.c @@ -201,10 +201,12 @@ ao_flight(void) break; +#if 0 case ao_flight_idle: case ao_flight_invalid: printf("+g %d ga %d sa %d accel %ld speed %ld\n", ao_config.accel_plus_g, ao_ground_accel, ao_sample_accel, ao_accel, ao_speed); break; +#endif case ao_flight_pad: /* pad to boost: @@ -222,8 +224,10 @@ ao_flight(void) */ if (ao_height > AO_M_TO_HEIGHT(20) #if HAS_ACCEL - || (ao_accel > AO_MSS_TO_ACCEL(20) && - ao_speed > AO_MS_TO_SPEED(5)) + || (ao_accel > AO_MSS_TO_ACCEL(20) +#if HAS_BARO + && ao_speed > AO_MS_TO_SPEED(5)) +#endif #endif ) {