diff options
author | Bdale Garbee <bdale@gag.com> | 2017-08-28 12:05:57 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2017-08-28 12:05:57 -0600 |
commit | 1afcdb1f26d10f535e4467174688191b0194377e (patch) | |
tree | ee4412dae28490fb4c1d38631c2fbee9cf44a480 /src/kernel/ao_flight.c | |
parent | 5376d4c904de57e289f12ee201690deebe34164b (diff) | |
parent | b1cf0dab1e28433e06ab02cec033951ea0149ea3 (diff) |
Merge branch 'branch-1.8' into debian
Diffstat (limited to 'src/kernel/ao_flight.c')
-rw-r--r-- | src/kernel/ao_flight.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kernel/ao_flight.c b/src/kernel/ao_flight.c index 50f2b68f..f06125cd 100644 --- a/src/kernel/ao_flight.c +++ b/src/kernel/ao_flight.c @@ -269,7 +269,7 @@ ao_flight(void) * number of seconds. */ if (ao_config.apogee_lockout) { - if ((ao_sample_tick - ao_boost_tick) < + if ((int16_t) (ao_sample_tick - ao_boost_tick) < AO_SEC_TO_TICKS(ao_config.apogee_lockout)) break; } @@ -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 ) { |