From: Keith Packard Date: Wed, 21 May 2014 08:34:27 +0000 (-0700) Subject: altos: Allow APRS to send just battery voltage X-Git-Tag: 1.3.2.2~84 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=cb228304d8df3063914ab505a530d4ea79ca027d;ds=sidebyside altos: Allow APRS to send just battery voltage Don't require apogee and main voltages as well Signed-off-by: Keith Packard --- diff --git a/src/drivers/ao_aprs.c b/src/drivers/ao_aprs.c index 0a6c72ce..679dd7bc 100644 --- a/src/drivers/ao_aprs.c +++ b/src/drivers/ao_aprs.c @@ -512,23 +512,38 @@ static int tncComment(uint8_t *buf) { #if HAS_ADC struct ao_data packet; - + ao_arch_critical(ao_data_get(&packet);); int16_t battery = ao_battery_decivolt(packet.adc.v_batt); +#ifdef AO_SENSE_DROGUE int16_t apogee = ao_ignite_decivolt(AO_SENSE_DROGUE(&packet)); +#endif +#ifdef AO_SENSE_MAIN int16_t main = ao_ignite_decivolt(AO_SENSE_MAIN(&packet)); +#endif return sprintf((char *) buf, - "%c%d B%d.%d A%d.%d M%d.%d", - ao_gps_locked(), + "%c%d B%d.%d" +#ifdef AO_SENSE_DROGUE + " A%d.%d" +#endif +#ifdef AO_SENSE_MAIN + " M%d.%d" +#endif + , ao_gps_locked(), ao_num_sats(), battery/10, - battery % 10, - apogee/10, - apogee%10, - main/10, - main%10); + battery % 10 +#ifdef AO_SENSE_DROGUE + , apogee/10, + apogee%10 +#endif +#ifdef AO_SENSE_MAIN + , main/10, + main%10 +#endif + ); #else return sprintf((char *) buf, "%c%d",