From e37fceee98612fbb8c75abaa639cefb80ca5eeca Mon Sep 17 00:00:00 2001 From: Tom VA7TA Date: Tue, 6 Feb 2018 17:45:58 -0800 Subject: [PATCH] va7ta update --- LibAPRS/examples/Basic_usage/Basic_usage.ino | 29 +++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/LibAPRS/examples/Basic_usage/Basic_usage.ino b/LibAPRS/examples/Basic_usage/Basic_usage.ino index 73b7452..8e598a4 100644 --- a/LibAPRS/examples/Basic_usage/Basic_usage.ino +++ b/LibAPRS/examples/Basic_usage/Basic_usage.ino @@ -11,6 +11,10 @@ // OR //#define ADC_REFERENCE REF_5V +// '!'(33) for no messaging; '='(61)if APRS messaging available +#define APRS_DATA_TYPE_FLAG '=' // va7ta update + +// Note some squelch delays are too short for catching APRS packets. // You can also define whether your modem will be // running with an open squelch radio: #define OPEN_SQUELCH false @@ -31,6 +35,9 @@ boolean gotPacket = false; AX25Msg incomingPacket; uint8_t *packetData; + +using namespace AFSKADCINIT;//provides access for re-initializing ADC for AFSK decoding + void aprs_msg_callback(struct AX25Msg *msg) { // If we already have a packet waiting to be // processed, we must drop the new one. @@ -109,6 +116,8 @@ void locationUpdateExample() { APRS_setHeight(4); APRS_setGain(7); APRS_setDirectivity(0); + APRS_setDataTypeID(APRS_DATA_TYPE_FLAG);//flags if APRS messaging is available (va7ta update) + // We'll define a comment string char *comment = "LibAPRS location update"; @@ -164,6 +173,14 @@ void processPacket() { boolean whichExample = false; void loop() { + /* va7ta update: + * insert this statement immediately after using the ADC for + * other possible functions such as measuring a voltage from + * a sensor. This is needed to re-configure the ADC for AFSK + * decoding. + */ + // AFSKADCINIT::AFSK_hw_init();// re-initialize AFSK operation + delay(1000); if (whichExample) { locationUpdateExample(); @@ -174,4 +191,14 @@ void loop() { delay(500); processPacket(); -} \ No newline at end of file + /* // monitor packet data errors - Note: cannot be used with open squelch + * if(CRC_Err==true){ + Serial.println(F("CRC_Error")); + CRC_Err=false; + }*/ + // Flag any buffer overrun errors + if(fullBfrErr==true){ + Serial.println(F("FullBufferError")); + fullBfrErr=false; + } +}