altos: Encode TeleGPS battery voltage in configuration packet
authorKeith Packard <keithp@keithp.com>
Sun, 8 Jun 2014 04:57:43 +0000 (21:57 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 8 Jun 2014 05:30:26 +0000 (22:30 -0700)
TeleGPS doesn't need apogee delay, so re-purpose it for the battery voltage

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_telemetry.c

index 2292d229d673a02b6b8ef1ebd87d45720f0fc9dc..dcda0dd7fdb451e3f797fa2f2213f4465c931111 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,