altos: Reduce configuration data telemetry to once per 5 seconds
[fw/altos] / src / kernel / ao_telemetry.c
index 2292d229d673a02b6b8ef1ebd87d45720f0fc9dc..6fb30069ee5be977a6112b2058cf3753c5111f7a 100644 (file)
@@ -305,8 +305,14 @@ ao_send_configuration(void)
 #endif
                telemetry.configuration.config_major = AO_CONFIG_MAJOR;
                telemetry.configuration.config_minor = AO_CONFIG_MINOR;
+#if AO_idProduct_NUMBER == 0x25 && HAS_ADC
+               /* TeleGPS gets battery voltage instead of apogee delay */
+               telemetry.configuration.apogee_delay = ao_data_ring[ao_data_ring_prev(ao_data_head)].adc.v_batt;
+#else
                telemetry.configuration.apogee_delay = ao_config.apogee_delay;
                telemetry.configuration.main_deploy = ao_config.main_deploy;
+#endif
+
                telemetry.configuration.flight_log_max = ao_config.flight_log_max >> 10;
                ao_xmemcpy (telemetry.configuration.callsign,
                            ao_config.callsign,
@@ -334,9 +340,6 @@ ao_send_location(void)
                ao_xmemcpy(&telemetry.location.flags,
                       &ao_gps_data.flags,
                       26);
-#if HAS_TRACKER
-               telemetry.location.state = ao_flight_state | AO_GPS_STATE_VALID;
-#endif
                telemetry.location.tick = ao_gps_tick;
                ao_mutex_put(&ao_gps_mutex);
                ao_radio_send(&telemetry, sizeof (telemetry));
@@ -518,7 +521,7 @@ ao_telemetry_set_interval(uint16_t interval)
        ao_telemetry_companion_cur = cur;
 #endif
 
-       ao_telemetry_config_max = AO_SEC_TO_TICKS(1) / interval;
+       ao_telemetry_config_max = AO_SEC_TO_TICKS(5) / interval;
 #if HAS_COMPANION
        if (ao_telemetry_config_max > cur)
                cur++;