altos: Put locked/unlocked GPS status in APRS comments
authorKeith Packard <keithp@keithp.com>
Mon, 10 Feb 2014 06:54:31 +0000 (22:54 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 10 Feb 2014 06:54:31 +0000 (22:54 -0800)
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 <keithp@keithp.com>
src/drivers/ao_aprs.c

index d472af4eb336fa7669d06cd58a1c252c775bf4ca..0a6c72ce9e2a1af03fd81f131982bf660e6e78fb 100644 (file)
@@ -500,6 +500,14 @@ static int ao_num_sats(void)
     return n;
 }
 
     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
 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,
        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,
                       ao_num_sats(),
                       battery/10,
                       battery % 10,
@@ -522,7 +531,9 @@ static int tncComment(uint8_t *buf)
                       main%10);
 #else
        return sprintf((char *) buf,
                       main%10);
 #else
        return sprintf((char *) buf,
-                      "S: %d", ao_num_sats());
+                      "%c%d",
+                      ao_gps_locked(),
+                      ao_num_sats());
 #endif
 }
 
 #endif
 }