summaryrefslogtreecommitdiff
path: root/src/ao_flight.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-06 21:00:52 -0800
committerKeith Packard <keithp@keithp.com>2011-03-16 15:57:37 -0700
commit2d41358c80f2eb8b6e98d699149bb941a6671475 (patch)
treefc01bc1e79f7750719404801f2505aaeb0c569e3 /src/ao_flight.c
parent1e56ed44e562f808addfd76bfb352f981db94094 (diff)
altos: Start with packet slave running. Turn off in pad mode.
Instead of turning slave mode on in idle mode, start with it running and disable it in pad mode instead. This means packet mode is available in startup mode too. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_flight.c')
-rw-r--r--src/ao_flight.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ao_flight.c b/src/ao_flight.c
index 843865e8..8e370c4f 100644
--- a/src/ao_flight.c
+++ b/src/ao_flight.c
@@ -358,10 +358,6 @@ ao_flight(void)
* (or uncalibrated values), so we go into invalid mode
*/
ao_flight_state = ao_flight_invalid;
- /* Allow packet mode in invalid flight state,
- * Still need to be able to fix the problem!
- */
- ao_packet_slave_start();
} else
#endif
@@ -380,6 +376,10 @@ ao_flight(void)
*/
ao_usb_disable();
#endif
+
+ /* Disable packet mode in pad state */
+ ao_packet_slave_stop();
+
/* Turn on telemetry system */
ao_rdf_set(1);
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_PAD);
@@ -390,9 +390,6 @@ ao_flight(void)
/* Set idle mode */
ao_flight_state = ao_flight_idle;
- /* Turn on packet system in idle mode */
- ao_packet_slave_start();
-
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
}