@@ -406,7 +406,7 @@ void SFE_UBLOX_GNSS::setPacketCfgPayloadSize(size_t payloadSize)
406
406
}
407
407
408
408
// Initialize the I2C port
409
- bool SFE_UBLOX_GNSS::begin (TwoWire &wirePort, uint8_t deviceAddress)
409
+ bool SFE_UBLOX_GNSS::begin (TwoWire &wirePort, uint8_t deviceAddress, uint16_t maxWait )
410
410
{
411
411
commType = COMM_TYPE_I2C;
412
412
_i2cPort = &wirePort; // Grab which port the user wants us to use
@@ -429,19 +429,19 @@ bool SFE_UBLOX_GNSS::begin(TwoWire &wirePort, uint8_t deviceAddress)
429
429
createFileBuffer ();
430
430
431
431
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
432
- bool connected = isConnected ();
432
+ bool connected = isConnected (maxWait );
433
433
434
434
if (!connected)
435
- connected = isConnected ();
435
+ connected = isConnected (maxWait );
436
436
437
437
if (!connected)
438
- connected = isConnected ();
438
+ connected = isConnected (maxWait );
439
439
440
440
return (connected);
441
441
}
442
442
443
443
// Initialize the Serial port
444
- bool SFE_UBLOX_GNSS::begin (Stream &serialPort)
444
+ bool SFE_UBLOX_GNSS::begin (Stream &serialPort, uint16_t maxWait )
445
445
{
446
446
commType = COMM_TYPE_SERIAL;
447
447
_serialPort = &serialPort; // Grab which port the user wants us to use
@@ -454,19 +454,19 @@ bool SFE_UBLOX_GNSS::begin(Stream &serialPort)
454
454
createFileBuffer ();
455
455
456
456
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
457
- bool connected = isConnected ();
457
+ bool connected = isConnected (maxWait );
458
458
459
459
if (!connected)
460
- connected = isConnected ();
460
+ connected = isConnected (maxWait );
461
461
462
462
if (!connected)
463
- connected = isConnected ();
463
+ connected = isConnected (maxWait );
464
464
465
465
return (connected);
466
466
}
467
467
468
468
// Initialize for SPI
469
- bool SFE_UBLOX_GNSS::begin (SPIClass &spiPort, uint8_t csPin, uint32_t spiSpeed)
469
+ bool SFE_UBLOX_GNSS::begin (SPIClass &spiPort, uint8_t csPin, uint32_t spiSpeed, uint16_t maxWait )
470
470
{
471
471
commType = COMM_TYPE_SPI;
472
472
_spiPort = &spiPort;
@@ -507,13 +507,13 @@ bool SFE_UBLOX_GNSS::begin(SPIClass &spiPort, uint8_t csPin, uint32_t spiSpeed)
507
507
}
508
508
509
509
// Call isConnected up to three times
510
- bool connected = isConnected ();
510
+ bool connected = isConnected (maxWait );
511
511
512
512
if (!connected)
513
- connected = isConnected ();
513
+ connected = isConnected (maxWait );
514
514
515
515
if (!connected)
516
- connected = isConnected ();
516
+ connected = isConnected (maxWait );
517
517
518
518
return (connected);
519
519
}
0 commit comments