diff options
author | Keith Packard <keithp@keithp.com> | 2011-09-27 21:06:54 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-09-27 21:30:55 -0700 |
commit | bbc46241a5c5f15b74d37b1d032e6cde28b501a9 (patch) | |
tree | b607b09e4683420bab0ec830368761af67e32b4e /src/ao_flight.c | |
parent | ac7633630c1b04fdd761c16af7bd9377e76926c5 (diff) |
altos: TM: Don't turn on packet slave mode until idle/invalid state
Leave the packet link disabled until we've checked the
accelerometer. That way, we cannot accidentally get to idle mode when
the rocket is on the rail.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_flight.c')
-rw-r--r-- | src/ao_flight.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ao_flight.c b/src/ao_flight.c index 85c1825b..0a9cc046 100644 --- a/src/ao_flight.c +++ b/src/ao_flight.c @@ -91,6 +91,8 @@ ao_flight(void) */ ao_flight_state = ao_flight_invalid; + /* Turn on packet system in invalid mode on TeleMetrum */ + ao_packet_slave_start(); } else #endif if (!ao_flight_force_idle @@ -108,8 +110,10 @@ ao_flight(void) ao_usb_disable(); #endif - /* Disable packet mode in pad state */ +#if !HAS_ACCEL + /* Disable packet mode in pad state on TeleMini */ ao_packet_slave_stop(); +#endif /* Turn on telemetry system */ ao_rdf_set(1); @@ -121,6 +125,11 @@ ao_flight(void) /* Set idle mode */ ao_flight_state = ao_flight_idle; +#if HAS_ACCEL + /* Turn on packet system in idle mode on TeleMetrum */ + ao_packet_slave_start(); +#endif + /* signal successful initialization by turning off the LED */ ao_led_off(AO_LED_RED); } |