diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-21 01:34:27 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-21 01:43:12 -0700 |
commit | cb228304d8df3063914ab505a530d4ea79ca027d (patch) | |
tree | f10627a864016d4fb26a681433a20f3d70136ac1 | |
parent | ca338a897ba3237652a3ae092e660f26c9e35074 (diff) |
altos: Allow APRS to send just battery voltage
Don't require apogee and main voltages as well
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/drivers/ao_aprs.c | 31 |
1 files changed, 23 insertions, 8 deletions
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", |