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

Commit 99de3be

Browse files
authored
Merge pull request #61 from PaulZC/PaulZC_checksumFailurePin
Added checksumFailurePin
2 parents 8e79205 + 446b27e commit 99de3be

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,12 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX)
526526
debugPrintln((char *)"Checksum failed. Response too big?");
527527

528528
//Drive an external pin to allow for easier logic analyzation
529-
digitalWrite(2, LOW);
530-
delay(10);
531-
digitalWrite(2, HIGH);
529+
if (checksumFailurePin >= 0)
530+
{
531+
digitalWrite((uint8_t)checksumFailurePin, LOW);
532+
delay(10);
533+
digitalWrite((uint8_t)checksumFailurePin, HIGH);
534+
}
532535

533536
_debugSerial->print(F("Size: "));
534537
_debugSerial->print(incomingUBX->len);

src/SparkFun_Ublox_Arduino_Library.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
#endif
7777
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7878

79+
//Define a digital pin to aid checksum failure capture and analysis
80+
//Leave set to -1 if not needed
81+
const int checksumFailurePin = -1;
82+
7983
//Registers
8084
const uint8_t UBX_SYNCH_1 = 0xB5;
8185
const uint8_t UBX_SYNCH_2 = 0x62;

0 commit comments

Comments
 (0)