X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fteleballoon-v1.1%2Fao_balloon.c;h=12752d1f8d3655f252ba2ba62dc6c29b63d99802;hb=9d2eb0b00a5a0faefce95bce949be7206b0aad37;hp=08a3ae1e24c40755e3bded22182a1c39ca02687d;hpb=eb61f7aa2c8b692bd892b85e782f249187c80e5c;p=fw%2Faltos diff --git a/src/teleballoon-v1.1/ao_balloon.c b/src/teleballoon-v1.1/ao_balloon.c index 08a3ae1e..12752d1f 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); } @@ -131,8 +105,8 @@ ao_flight(void) #if HAS_GPS /* Record current GPS position by waking up GPS log tasks */ - ao_wakeup(&ao_gps_data); - ao_wakeup(&ao_gps_tracking_data); + ao_gps_new = AO_GPS_NEW_DATA | AO_GPS_NEW_TRACKING; + ao_wakeup(&ao_gps_new); #endif ao_wakeup(DATA_TO_XDATA(&ao_flight_state));