From: Keith Packard Date: Mon, 10 Feb 2014 06:54:31 +0000 (-0800) Subject: altos: Put locked/unlocked GPS status in APRS comments X-Git-Tag: 1.3.2~3 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=e76948d382cf6980c3a5b6c48405d71c8811780b;hp=5001a0f882af53dde33fc531215944c9d727baf4;ds=sidebyside 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 --- 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 }