Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit 864a3a5

Browse files
committed
Adding an extra debug print for overrun
1 parent 94cceea commit 864a3a5

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

Diff for: examples/ZED-F9P/Example13_autoHPPOSLLH/Example13_autoHPPOSLLH.ino

+13-12
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void setup()
4343
Wire.begin();
4444

4545
//myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages
46+
//myGPS.enableDebugging(Serial, true); // Uncomment this line to enable the minimum of helpful debug messages
4647

4748
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
4849
{
@@ -55,21 +56,21 @@ void setup()
5556

5657
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
5758
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR
58-
59+
5960
myGPS.setNavigationFrequency(1); //Produce one solution per second
60-
61+
6162

6263
// The acid test: all four of these combinations should work seamlessly :-)
63-
64+
6465
//myGPS.setAutoPVT(false); // Library will poll each reading
6566
//myGPS.setAutoHPPOSLLH(false); // Library will poll each reading
66-
67+
6768
//myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically
6869
//myGPS.setAutoHPPOSLLH(false); // Library will poll each reading
6970

7071
//myGPS.setAutoPVT(false); // Library will poll each reading
7172
//myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically
72-
73+
7374
myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically
7475
myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically
7576
}
@@ -81,31 +82,31 @@ void loop()
8182
if ((myGPS.getHPPOSLLH()) || (myGPS.getPVT()))
8283
{
8384
Serial.println();
84-
85+
8586
long highResLatitude = myGPS.getHighResLatitude();
8687
Serial.print(F("Hi Res Lat: "));
8788
Serial.print(highResLatitude);
88-
89+
8990
int highResLatitudeHp = myGPS.getHighResLatitudeHp();
9091
Serial.print(F(" "));
9192
Serial.print(highResLatitudeHp);
92-
93+
9394
long highResLongitude = myGPS.getHighResLongitude();
9495
Serial.print(F(" Hi Res Long: "));
9596
Serial.print(highResLongitude);
96-
97+
9798
int highResLongitudeHp = myGPS.getHighResLongitudeHp();
9899
Serial.print(F(" "));
99100
Serial.print(highResLongitudeHp);
100-
101+
101102
unsigned long horizAccuracy = myGPS.getHorizontalAccuracy();
102103
Serial.print(F(" Horiz accuracy: "));
103104
Serial.print(horizAccuracy);
104-
105+
105106
long latitude = myGPS.getLatitude();
106107
Serial.print(F(" Lat: "));
107108
Serial.print(latitude);
108-
109+
109110
long longitude = myGPS.getLongitude();
110111
Serial.print(F(" Long: "));
111112
Serial.println(longitude);

Diff for: src/SparkFun_Ublox_Arduino_Library.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -951,13 +951,16 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t
951951
//Increment the counter
952952
incomingUBX->counter++;
953953

954-
if (overrun or incomingUBX->counter == MAX_PAYLOAD_SIZE)
954+
if (overrun || (incomingUBX->counter == MAX_PAYLOAD_SIZE))
955955
{
956956
//Something has gone very wrong
957957
currentSentence = NONE; //Reset the sentence to being looking for a new start char
958-
if (_printDebug == true)
958+
if ((_printDebug == true) || (_printLimitedDebug == true)) // Print this if doing limited debugging
959959
{
960-
_debugSerial->println(F("processUBX: counter hit MAX_PAYLOAD_SIZE"));
960+
if (overrun)
961+
_debugSerial->println(F("processUBX: buffer overrun detected"));
962+
else
963+
_debugSerial->println(F("processUBX: counter hit MAX_PAYLOAD_SIZE"));
961964
}
962965
}
963966
}

0 commit comments

Comments
 (0)