summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-21 14:58:26 -0700
committerKeith Packard <keithp@keithp.com>2011-10-21 14:58:26 -0700
commit85b259c5bba7edbd2a79471bb1104bcf3904d536 (patch)
treede70aee50054b1fc8e777a783400d6d6c1531309
parenteb61f7aa2c8b692bd892b85e782f249187c80e5c (diff)
src/teleballoon-v1.1: Use Tm style initial state stuff
Come up in pad mode unless someone talks to us while in idle mode. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/teleballoon-v1.1/ao_balloon.c30
-rw-r--r--src/teleballoon-v1.1/ao_teleballoon.c2
2 files changed, 3 insertions, 29 deletions
diff --git a/src/teleballoon-v1.1/ao_balloon.c b/src/teleballoon-v1.1/ao_balloon.c
index 08a3ae1e..e8972655 100644
--- a/src/teleballoon-v1.1/ao_balloon.c
+++ b/src/teleballoon-v1.1/ao_balloon.c
@@ -59,26 +59,7 @@ ao_flight(void)
* - pad mode if we're upright,
* - idle mode otherwise
*/
-#if HAS_ACCEL
- if (ao_config.accel_plus_g == 0 ||
- ao_config.accel_minus_g == 0 ||
- ao_ground_accel < ao_config.accel_plus_g - ACCEL_NOSE_UP ||
- ao_ground_accel > ao_config.accel_minus_g + ACCEL_NOSE_UP)
- {
- /* Detected an accel value outside -1.5g to 1.5g
- * (or uncalibrated values), so we go into invalid mode
- */
- 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
-#if HAS_ACCEL
- && ao_ground_accel < ao_config.accel_plus_g + ACCEL_NOSE_UP
-#endif
- )
+ if (!ao_flight_force_idle)
{
/* Set pad mode - we can fly! */
ao_flight_state = ao_flight_pad;
@@ -89,10 +70,8 @@ ao_flight(void)
ao_usb_disable();
#endif
-#if !HAS_ACCEL
- /* Disable packet mode in pad state on TeleMini */
+ /* Disable packet mode in pad state */
ao_packet_slave_stop();
-#endif
/* Turn on telemetry system */
ao_rdf_set(1);
@@ -104,11 +83,6 @@ 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/teleballoon-v1.1/ao_teleballoon.c b/src/teleballoon-v1.1/ao_teleballoon.c
index a48e21d2..3f12a59c 100644
--- a/src/teleballoon-v1.1/ao_teleballoon.c
+++ b/src/teleballoon-v1.1/ao_teleballoon.c
@@ -65,7 +65,7 @@ main(void)
ao_gps_report_init();
ao_telemetry_init();
ao_radio_init();
- ao_packet_slave_init(FALSE);
+ ao_packet_slave_init(TRUE);
#if HAS_DBG
ao_dbg_init();
#endif