@@ -45,6 +45,12 @@ SFE_UBLOX_GPS::SFE_UBLOX_GPS(void)
45
45
// Constructor
46
46
currentGeofenceParams.numFences = 0 ; // Zero the number of geofences currently in use
47
47
moduleQueried.versionNumber = false ;
48
+
49
+ if (checksumFailurePin >= 0 )
50
+ {
51
+ pinMode ((uint8_t )checksumFailurePin, OUTPUT);
52
+ digitalWrite ((uint8_t )checksumFailurePin, HIGH);
53
+ }
48
54
}
49
55
50
56
// Initialize the Serial port
@@ -282,6 +288,12 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
282
288
{
283
289
// I believe this is a Ublox bug. Device should never present an 0xFF.
284
290
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
+ }
285
297
lastCheck = millis (); // Put off checking to avoid I2C bus traffic
286
298
return (false );
287
299
}
@@ -307,6 +319,12 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
307
319
{
308
320
_debugSerial->print (F (" checkUbloxI2C: Bytes available error:" ));
309
321
_debugSerial->println (bytesAvailable);
322
+ if (checksumFailurePin >= 0 )
323
+ {
324
+ digitalWrite ((uint8_t )checksumFailurePin, LOW);
325
+ delay (10 );
326
+ digitalWrite ((uint8_t )checksumFailurePin, HIGH);
327
+ }
310
328
}
311
329
}
312
330
@@ -356,8 +374,14 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
356
374
{
357
375
if (incoming == 0x7F )
358
376
{
359
- debugPrintln ((char *)F (" Module not ready with data" ));
377
+ debugPrintln ((char *)F (" checkUbloxU2C: Ublox error, module not ready with data" ));
360
378
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
+ }
361
385
goto TRY_AGAIN;
362
386
}
363
387
}
0 commit comments