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>
*/
ao_flight_state = ao_flight_invalid;
*/
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
} else
#endif
if (!ao_flight_force_idle
- /* Disable packet mode in pad state */
+#if !HAS_ACCEL
+ /* Disable packet mode in pad state on TeleMini */
/* Turn on telemetry system */
ao_rdf_set(1);
/* Turn on telemetry system */
ao_rdf_set(1);
/* Set idle mode */
ao_flight_state = ao_flight_idle;
/* 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);
}
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
}
void
ao_packet_slave_start(void)
{
void
ao_packet_slave_start(void)
{
- ao_packet_enable = 1;
- ao_add_task(&ao_packet_task, ao_packet_slave, "slave");
+ if (!ao_packet_enable) {
+ ao_packet_enable = 1;
+ ao_add_task(&ao_packet_task, ao_packet_slave, "slave");
+ }
ao_gps_report_init();
ao_telemetry_init();
ao_radio_init();
ao_gps_report_init();
ao_telemetry_init();
ao_radio_init();
- ao_packet_slave_init(TRUE);
+ ao_packet_slave_init(FALSE);
ao_igniter_init();
#if HAS_DBG
ao_dbg_init();
ao_igniter_init();
#if HAS_DBG
ao_dbg_init();