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

Commit ca2c076

Browse files
author
Nathan Seidle
committedJan 8, 2020
Add debug pin to more errors.
1 parent 613b0d3 commit ca2c076

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed
 

‎src/SparkFun_Ublox_Arduino_Library.cpp

+25-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ SFE_UBLOX_GPS::SFE_UBLOX_GPS(void)
4545
// Constructor
4646
currentGeofenceParams.numFences = 0; // Zero the number of geofences currently in use
4747
moduleQueried.versionNumber = false;
48+
49+
if (checksumFailurePin >= 0)
50+
{
51+
pinMode((uint8_t)checksumFailurePin, OUTPUT);
52+
digitalWrite((uint8_t)checksumFailurePin, HIGH);
53+
}
4854
}
4955

5056
//Initialize the Serial port
@@ -282,6 +288,12 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
282288
{
283289
//I believe this is a Ublox bug. Device should never present an 0xFF.
284290
debugPrintln((char *)F("checkUbloxI2C: Ublox bug, no bytes available"));
291+
if (checksumFailurePin >= 0)
292+
{
293+
digitalWrite((uint8_t)checksumFailurePin, LOW);
294+
delay(10);
295+
digitalWrite((uint8_t)checksumFailurePin, HIGH);
296+
}
285297
lastCheck = millis(); //Put off checking to avoid I2C bus traffic
286298
return (false);
287299
}
@@ -307,6 +319,12 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
307319
{
308320
_debugSerial->print(F("checkUbloxI2C: Bytes available error:"));
309321
_debugSerial->println(bytesAvailable);
322+
if (checksumFailurePin >= 0)
323+
{
324+
digitalWrite((uint8_t)checksumFailurePin, LOW);
325+
delay(10);
326+
digitalWrite((uint8_t)checksumFailurePin, HIGH);
327+
}
310328
}
311329
}
312330

@@ -356,8 +374,14 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
356374
{
357375
if (incoming == 0x7F)
358376
{
359-
debugPrintln((char *)F("Module not ready with data"));
377+
debugPrintln((char *)F("checkUbloxU2C: Ublox error, module not ready with data"));
360378
delay(5); //In logic analyzation, the module starting responding after 1.48ms
379+
if (checksumFailurePin >= 0)
380+
{
381+
digitalWrite((uint8_t)checksumFailurePin, LOW);
382+
delay(10);
383+
digitalWrite((uint8_t)checksumFailurePin, HIGH);
384+
}
361385
goto TRY_AGAIN;
362386
}
363387
}

0 commit comments

Comments
 (0)
This repository has been archived.