From e76948d382cf6980c3a5b6c48405d71c8811780b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 9 Feb 2014 22:54:31 -0800 Subject: [PATCH 1/1] altos: Put locked/unlocked GPS status in APRS comments Replace the 'S' (which marks the field showing sats in view) with either 'L' or 'U' to tell the user whether the GPS receiver is locked or unlocked. This also removes the colons in the comment field to shorten it. This makes it fit on one line of my FT1D display. Signed-off-by: Keith Packard --- src/drivers/ao_aprs.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/drivers/ao_aprs.c b/src/drivers/ao_aprs.c index d472af4e..0a6c72ce 100644 --- a/src/drivers/ao_aprs.c +++ b/src/drivers/ao_aprs.c @@ -500,6 +500,14 @@ static int ao_num_sats(void) return n; } +static char ao_gps_locked(void) +{ + if (ao_gps_data.flags & AO_GPS_VALID) + return 'L'; + else + return 'U'; +} + static int tncComment(uint8_t *buf) { #if HAS_ADC @@ -512,7 +520,8 @@ static int tncComment(uint8_t *buf) int16_t main = ao_ignite_decivolt(AO_SENSE_MAIN(&packet)); return sprintf((char *) buf, - "S: %d B:%d.%d A:%d.%d M:%d.%d", + "%c%d B%d.%d A%d.%d M%d.%d", + ao_gps_locked(), ao_num_sats(), battery/10, battery % 10, @@ -522,7 +531,9 @@ static int tncComment(uint8_t *buf) main%10); #else return sprintf((char *) buf, - "S: %d", ao_num_sats()); + "%c%d", + ao_gps_locked(), + ao_num_sats()); #endif } -- 2.30.2