altos: Generate all of the APRS messages
authorKeith Packard <keithp@keithp.com>
Thu, 6 Dec 2012 04:10:54 +0000 (20:10 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 6 Dec 2012 04:10:54 +0000 (20:10 -0800)
Note that two of them are in NMEA form, which some receivers appear
not to parse

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_aprs.c
src/test/ao_aprs_test.c

index df68278c3d71b057af82c2ea7610736f77fadb30..0a41d5fd3e56ccde8c8dd298a6ca97827097d2ef 100644 (file)
@@ -395,7 +395,7 @@ const uint32_t freqTable[256] =
 void ddsSetFTW (uint32_t ftw)
 {
     int        x = ftw - freqTable[0];
-    putchar (x > 0 ? 0xff : 0x0);
+    putchar (x > 0 ? 0xc0 : 0x40);
 }
 
 /**
@@ -1243,6 +1243,10 @@ tncPrintf(char *fmt, ...)
 
     va_start(ap, fmt);
     c = vsprintf((char *) tncBufferPnt, fmt, ap);
+    if (*fmt == '\015')
+       fprintf (stderr, "\n");
+    else
+       vfprintf(stderr, fmt, ap);
     va_end(ap);
     tncBufferPnt += c;
     tncLength += c;
@@ -1378,7 +1382,7 @@ void tncStatusPacket(int16_t temperature)
     tncPrintf (">ANSR ");
     
     // Display the flight time.
-    tncPrintf ("%02U:%02U:%02U ", timeHours, timeMinutes, timeSeconds);
+    tncPrintf ("%02u:%02u:%02u ", timeHours, timeMinutes, timeSeconds);
     
     // Altitude in feet.
     tncPrintf ("%ld' ", gpsPosition.altitudeFeet);
index d791e93030900a73105941c6c5664e7795238ed8..1c0b252bc5cd564550d3828d39df38b157ef2c55 100644 (file)
 
  */
 
-// This is where we go after reset.
-int main(int argc, char **argv)
+static void
+audio_gap(int secs)
 {
-    uint8_t utcSeconds, lockLostCounter;
-
-//test();
+       int     samples = secs * 9600;
 
-    // Configure the basic systems.
-//    sysInit();
-
-    // Wait for the power converter chains to stabilize.
-//    delay_ms (100);
+       while (samples--)
+               putchar(0x7f);
+}
 
-    // Setup the subsystems.
-//    adcInit();
-//    flashInit();
+// This is where we go after reset.
+int main(int argc, char **argv)
+{
+    uint8_t utcSeconds, lockLostCounter, i;
     gpsInit();
-//    logInit();
-//    timeInit();
-//    serialInit();
     tncInit();
 
-    // Program the DDS.
-//    ddsInit();
-
+    audio_gap(1);
     // Transmit software version packet on start up.
     tncTxPacket(TNC_MODE_1200_AFSK);
 
-    exit(0);
     // Counters to send packets if the GPS time stamp is not available.
     lockLostCounter = 5;
     utcSeconds = 55;
   
     // This is the main loop that process GPS data and waits for the once per second timer tick.
-    for (;;) 
+    for (i = 0; i < 5; i++)
     {
+           audio_gap(10);
         // Read the GPS engine serial port FIFO and process the GPS data.
 //        gpsUpdate();
 
@@ -138,6 +130,7 @@ int main(int argc, char **argv)
         } // END if timeIsUpdate
 
     } // END for
+    return 0;
 }