Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compile-sketch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
run: echo running on branch ${GITHUB_REF##*/}

- name: Compile Sketch
uses: arduino/compile-sketches@v1
uses: arduino/compile-sketches@v1.1.0
with:
platforms: ${{ matrix.board.platforms }}
fqbn: ${{ matrix.board.fqbn }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void loop()
// If it is more than i2cReadInterval_ms since the last read, read how
// many bytes are available in the GNSS I2C buffer. This will leave the register
// address pointing at 0xFF.
if ((millis() > (i2cLastRead_ms + i2cReadInterval_ms)) || (i2cLastRead_ms == 0))
if ((((millis() - i2cLastRead_ms) > i2cReadInterval_ms)) || (i2cLastRead_ms == 0))
{
i2cBytesAvailable = gnssI2cAvailable();
i2cLastRead_ms = millis();
Expand Down Expand Up @@ -115,7 +115,7 @@ void loop()
}
// Else if uartI2cRingBuffer contains data and it is more than uartI2cSendInterval_ms
// since the last send, send them
else if ((bytesToSend > 0) && (millis() > (uartI2cLastSend_ms + uartI2cSendInterval_ms)))
else if ((bytesToSend > 0) && ((millis() - uartI2cLastSend_ms) > uartI2cSendInterval_ms))
{
sendI2cBytes(bytesToSend);
uartI2cLastSend_ms = millis();
Expand Down Expand Up @@ -148,7 +148,7 @@ void loop()
}
// Else if i2cUartRingBuffer contains data and it is more than i2cUartSendInterval_ms
// since the last send, send them
else if ((bytesToSend > 0) && (millis() > (i2cUartLastSend_ms + i2cUartSendInterval_ms)))
else if ((bytesToSend > 0) && ((millis() - i2cUartLastSend_ms) > i2cUartSendInterval_ms))
{
sendUartBytes(bytesToSend);
i2cUartLastSend_ms = millis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print the message count once per second
if ((millis() - lastPrint) > 1000) // Print the message count once per second
{
Serial.print(F("Number of message groups received: SFRBX: ")); // Print how many message groups have been received (see note above)
Serial.print(numSFRBX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print bytesWritten once per second
if ((millis() - lastPrint) > 1000) // Print bytesWritten once per second
{
Serial.print(F("The number of bytes written to SD card is ")); // Print how many bytes have been written to SD card
Serial.println(bytesWritten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print bytesWritten once per second
if ((millis() - lastPrint) > 1000) // Print bytesWritten once per second
{
Serial.print(F("The number of bytes written to SD card is: ")); // Print how many bytes have been written to SD card
Serial.println(bytesWritten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print bytesWritten once per second
if ((millis() - lastPrint) > 1000) // Print bytesWritten once per second
{
Serial.print(F("The number of bytes written to SD card is ")); // Print how many bytes have been written to SD card
Serial.println(bytesWritten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print the message count once per second
if ((millis() - lastPrint) > 1000) // Print the message count once per second
{
uint16_t maxBufferBytes = myGNSS.getMaxFileBufferAvail(); // Get how full the file buffer has been (not how full it is now)
float bufferHigh = 100.0 * (float)maxBufferBytes / (float)fileBufferSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print bytesWritten once per second
if ((millis() - lastPrint) > 1000) // Print bytesWritten once per second
{
Serial.print(F("The number of bytes written to SD card is ")); // Print how many bytes have been written to SD card
Serial.println(bytesWritten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void loop()

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

if (millis() > (lastPrint + 1000)) // Print bytesWritten once per second
if ((millis() - lastPrint) > 1000) // Print bytesWritten once per second
{
Serial.print(F("The number of bytes written to SD card is ")); // Print how many bytes have been written to SD card
Serial.println(bytesWritten);
Expand Down
2 changes: 1 addition & 1 deletion examples/NEO-F10N/Example1_NAV_SIG/Example1_NAV_SIG.ino
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void loop()
void printDot() // Print a dot every 200ms - without using delay
{
static unsigned long lastPrint = millis();
if (millis() > (lastPrint + 200))
if ((millis() - lastPrint) > 200)
{
Serial.print(".");
lastPrint = millis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void setup()

unsigned long startTime = millis();
WiFi.begin(ssid, password);
while ((WiFi.status() != WL_CONNECTED) && (millis() < (startTime + 10000))) // Timeout after 10 seconds
while ((WiFi.status() != WL_CONNECTED) && ((millis() - startTime) < 10000)) // Timeout after 10 seconds
{
delay(500);
Serial.print(F("."));
Expand Down Expand Up @@ -421,7 +421,7 @@ bool beginClient()
unsigned long startTime = millis();
while (ntripClient.available() == 0)
{
if (millis() > (startTime + 5000))
if ((millis() - startTime) > 5000)
{
Serial.println(F("Caster timed out!"));
ntripClient.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void setup()

unsigned long startTime = millis();
WiFi.begin(ssid, password);
while ((WiFi.status() != WL_CONNECTED) && (millis() < (startTime + 10000))) // Timeout after 10 seconds
while ((WiFi.status() != WL_CONNECTED) && ((millis() - startTime) < 10000)) // Timeout after 10 seconds
{
delay(500);
Serial.print(F("."));
Expand Down Expand Up @@ -433,7 +433,7 @@ bool beginClient()
unsigned long startTime = millis();
while (ntripClient.available() == 0)
{
if (millis() > (startTime + 5000))
if ((millis() - startTime) > 5000)
{
Serial.println(F("Caster timed out!"));
ntripClient.stop();
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun u-blox GNSS v3
version=3.1.12
version=3.1.13
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules<br/><br/>
Expand Down
8 changes: 4 additions & 4 deletions src/u-blox_GNSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5680,7 +5680,7 @@ sfe_ublox_status_e DevUBLOXGNSS::waitForACKResponse(ubxPacket *outgoingUBX, uint
packetAuto.classAndIDmatch = SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED;

unsigned long startTime = millis();
while (millis() < (startTime + (unsigned long)maxTime))
while ((millis() - startTime) < (unsigned long)maxTime)
{
if (checkUbloxInternal(outgoingUBX, requestedClass, requestedID) == true) // See if new data is available. Process bytes as they come in.
{
Expand Down Expand Up @@ -5819,7 +5819,7 @@ sfe_ublox_status_e DevUBLOXGNSS::waitForACKResponse(ubxPacket *outgoingUBX, uint
} // checkUbloxInternal == true

delay(1); // Allow an RTOS to get an elbow in (#11)
} // while (millis() < (startTime + (unsigned long)maxTime))
} // while ((millis() - startTime) < (unsigned long)maxTime)

// We have timed out...
// If the outgoingUBX->classAndIDmatch is VALID then we can take a gamble and return DATA_RECEIVED
Expand Down Expand Up @@ -6837,7 +6837,7 @@ size_t DevUBLOXGNSS::pushAssistNowDataInternal(size_t offset, bool skipTime, con
{
unsigned long startTime = millis();
bool keepGoing = true;
while (keepGoing && (millis() < (startTime + maxWait))) // Keep checking for the ACK until we time out
while (keepGoing && ((millis() - startTime) < maxWait)) // Keep checking for the ACK until we time out
{
checkUbloxInternal(&packetCfg, 0, 0); // Call checkUbloxInternal to parse any incoming data. Don't overwrite the requested Class and ID. We could be pushing this from another thread...
if (packetUBXMGAACK->head != packetUBXMGAACK->tail) // Does the MGA ACK ringbuffer contain any ACK's?
Expand Down Expand Up @@ -7360,7 +7360,7 @@ size_t DevUBLOXGNSS::readNavigationDatabase(uint8_t *dataBytes, size_t maxNumDat
uint32_t databaseEntriesRX = 0; // Keep track of how many database entries are received
size_t numBytesReceived = 0; // Keep track of how many bytes are received

while (keepGoing && (millis() < (startTime + maxWait)))
while (keepGoing && ((millis() - startTime) < maxWait))
{
checkUbloxInternal(&packetCfg, 0, 0); // Call checkUbloxInternal to parse any incoming data. Don't overwrite the requested Class and ID. We could be pushing this from another thread...

Expand Down