@@ -438,7 +438,7 @@ void SFE_UBLOX_GNSS::setPacketCfgPayloadSize(size_t payloadSize)
438
438
}
439
439
440
440
//Initialize the I2C port
441
- bool SFE_UBLOX_GNSS::begin(TwoWire &wirePort, uint8_t deviceAddress)
441
+ bool SFE_UBLOX_GNSS::begin(TwoWire &wirePort, uint8_t deviceAddress, uint16_t maxWait )
442
442
{
443
443
commType = COMM_TYPE_I2C;
444
444
_i2cPort = &wirePort; //Grab which port the user wants us to use
@@ -461,19 +461,19 @@ bool SFE_UBLOX_GNSS::begin(TwoWire &wirePort, uint8_t deviceAddress)
461
461
createFileBuffer();
462
462
463
463
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
464
- bool connected = isConnected();
464
+ bool connected = isConnected(maxWait );
465
465
466
466
if (!connected)
467
- connected = isConnected();
467
+ connected = isConnected(maxWait );
468
468
469
469
if (!connected)
470
- connected = isConnected();
470
+ connected = isConnected(maxWait );
471
471
472
472
return (connected);
473
473
}
474
474
475
475
//Initialize the Serial port
476
- bool SFE_UBLOX_GNSS::begin(Stream &serialPort)
476
+ bool SFE_UBLOX_GNSS::begin(Stream &serialPort, uint16_t maxWait )
477
477
{
478
478
commType = COMM_TYPE_SERIAL;
479
479
_serialPort = &serialPort; //Grab which port the user wants us to use
@@ -486,19 +486,19 @@ bool SFE_UBLOX_GNSS::begin(Stream &serialPort)
486
486
createFileBuffer();
487
487
488
488
// Call isConnected up to three times - tests on the NEO-M8U show the CFG RATE poll occasionally being ignored
489
- bool connected = isConnected();
489
+ bool connected = isConnected(maxWait );
490
490
491
491
if (!connected)
492
- connected = isConnected();
492
+ connected = isConnected(maxWait );
493
493
494
494
if (!connected)
495
- connected = isConnected();
495
+ connected = isConnected(maxWait );
496
496
497
497
return (connected);
498
498
}
499
499
500
500
// Initialize for SPI
501
- bool SFE_UBLOX_GNSS::begin(SPIClass &spiPort, uint8_t csPin, uint32_t spiSpeed)
501
+ bool SFE_UBLOX_GNSS::begin(SPIClass &spiPort, uint8_t csPin, uint32_t spiSpeed, uint16_t maxWait )
502
502
{
503
503
commType = COMM_TYPE_SPI;
504
504
_spiPort = &spiPort;
@@ -539,13 +539,13 @@ bool SFE_UBLOX_GNSS::begin(SPIClass &spiPort, uint8_t csPin, uint32_t spiSpeed)
539
539
}
540
540
541
541
// Call isConnected up to three times
542
- bool connected = isConnected();
542
+ bool connected = isConnected(maxWait );
543
543
544
544
if (!connected)
545
- connected = isConnected();
545
+ connected = isConnected(maxWait );
546
546
547
547
if (!connected)
548
- connected = isConnected();
548
+ connected = isConnected(maxWait );
549
549
550
550
return (connected);
551
551
}
0 commit comments