From: Keith Packard Date: Fri, 7 Oct 2011 14:40:14 +0000 (-0600) Subject: Merge remote-tracking branch 'uniarch/master' into multiarch X-Git-Tag: 1.0.9.1~2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=f6f54d70b768dca1715ddddea64a4df00d82b09e;hp=1c344b760776cd5d8c0297d8db9bf02687381b4e Merge remote-tracking branch 'uniarch/master' into multiarch Conflicts: src/core/ao_cmd.c Use ao_arch_reboot after waiting for a second --- diff --git a/src/cc1111/ao_packet_slave.c b/src/cc1111/ao_packet_slave.c index 9f14052a..d7cafa68 100644 --- a/src/cc1111/ao_packet_slave.c +++ b/src/cc1111/ao_packet_slave.c @@ -37,8 +37,10 @@ ao_packet_slave(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"); + } } void diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index d0a46633..2b64b8ca 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -227,6 +227,12 @@ ao_reboot(void) ao_cmd_white(); if (!ao_match_word("eboot")) return; + /* Delay waiting for the packet master to be turned off + * so that we don't end up back in idle mode because we + * received a packet after boot. + */ + flush(); + ao_delay(AO_SEC_TO_TICKS(1)); ao_arch_reboot(); ao_panic(AO_PANIC_REBOOT); } diff --git a/src/core/ao_flight.c b/src/core/ao_flight.c index a5cf7468..433efeae 100644 --- a/src/core/ao_flight.c +++ b/src/core/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); } diff --git a/src/product/ao_telemetrum.c b/src/product/ao_telemetrum.c index f560740a..ea77f5af 100644 --- a/src/product/ao_telemetrum.c +++ b/src/product/ao_telemetrum.c @@ -57,7 +57,7 @@ main(void) 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();