summaryrefslogtreecommitdiff
path: root/src/core/ao_flight.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-04-14 12:02:14 -0700
committerKeith Packard <keithp@keithp.com>2012-04-14 14:04:29 -0700
commit6cb744e305116a738b5d71686c6748f6f08c12ea (patch)
tree536b510332adb5dd93f99c8c06b33a18b038d832 /src/core/ao_flight.c
parent9a8fec1b6d8f3346f988882ffb03d7d0e45b3c81 (diff)
altos: Respect apogee lockout time in flight algorithm
This prevents any apogee detection from occurring until the specified number of seconds after boost. This also prevents the switch from accel+baro to baro only mode in the Kalman filter. The test frame work is also changed to look for Apogee lockout: in the eeprom input file. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core/ao_flight.c')
-rw-r--r--src/core/ao_flight.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/ao_flight.c b/src/core/ao_flight.c
index 5e194638..494e656d 100644
--- a/src/core/ao_flight.c
+++ b/src/core/ao_flight.c
@@ -223,6 +223,17 @@ ao_flight(void)
#endif
case ao_flight_coast:
+ /*
+ * By customer request - allow the user
+ * to lock out apogee detection for a specified
+ * number of seconds.
+ */
+ if (ao_config.apogee_lockout) {
+ if ((ao_sample_tick - ao_boost_tick) <
+ AO_SEC_TO_TICKS(ao_config.apogee_lockout))
+ break;
+ }
+
/* apogee detect: coast to drogue deploy:
*
* speed: < 0