From: Keith Packard Date: Thu, 6 Dec 2012 05:13:37 +0000 (-0800) Subject: altos: Reduce printf calls in APRS packet generation X-Git-Tag: 1.1.9.3~10^2~30 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d717edd18a35376811d6be0d0c7522ee8cc426f9;p=fw%2Faltos altos: Reduce printf calls in APRS packet generation Merge all of the data into a single printf call Signed-off-by: Keith Packard --- diff --git a/src/drivers/ao_aprs.c b/src/drivers/ao_aprs.c index 3a51ae90..b45ef8c5 100644 --- a/src/drivers/ao_aprs.c +++ b/src/drivers/ao_aprs.c @@ -1270,7 +1270,6 @@ void tncPositionPacket(void) char lat_sign = 'N', lon_sign = 'E'; -// tncPrintf (">ANSR "); if (latitude < 0) { lat_sign = 'S'; latitude = -latitude; @@ -1295,11 +1294,10 @@ void tncPositionPacket(void) longitude -= lon_min * 10000000; lon_frac = (longitude + 50000) / 100000; - tncPrintf ("=%02u%02u.%02u%c\\%03u%02u.%02u%cO", + tncPrintf ("=%02u%02u.%02u%c\\%03u%02u.%02u%cO /A=%06u\015", lat_deg, lat_min, lat_frac, lat_sign, - lon_deg, lon_min, lon_frac, lon_sign); - - tncPrintf (" /A=%06u", altitude * 100 / 3048); + lon_deg, lon_min, lon_frac, lon_sign, + altitude * 100 / 3048); } /** @@ -1327,9 +1325,6 @@ void tncTxPacket(TNC_DATA_MODE dataMode) tncPositionPacket(); - // Add the end of message character. - tncPrintf ("\015"); - // Calculate the CRC for the header and message. crc = sysCRC16(TNC_AX25_HEADER, sizeof(TNC_AX25_HEADER), 0xffff); crc = sysCRC16(tncBuffer, tncLength, crc ^ 0xffff);