summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2011-01-15 23:21:26 +1300
committerKeith Packard <keithp@keithp.com>2011-01-16 14:35:29 -0800
commit58838c0b96a91da0bd0cd77c3ff312b589c08136 (patch)
treeca6c4967f7703e54b06535d5477069e5e627fe00
parent118fe84c9ff1cc9d1653e67a2315e22e19d60a14 (diff)
altos: Added check for an accel value above 1.5g
When detecting flight or idle mode, this should indicate that accel cal values are out of whack. Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r--src/ao_flight.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ao_flight.c b/src/ao_flight.c
index 9f651ae2..5a9a8d80 100644
--- a/src/ao_flight.c
+++ b/src/ao_flight.c
@@ -221,6 +221,7 @@ ao_flight(void)
if (ao_config.accel_plus_g != 0 &&
ao_config.accel_minus_g != 0 &&
ao_flight_accel < ao_config.accel_plus_g + ACCEL_NOSE_UP &&
+ ao_flight_accel > ao_config.accel_plus_g - ACCEL_NOSE_UP &&
!ao_flight_force_idle)
{
/* Disable the USB controller in flight mode