Skip to content

Commit 5b1ed81

Browse files
committed
VSC whitespace changes - sorry!
1 parent 5ff1218 commit 5b1ed81

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,7 +3749,7 @@ void SFE_UBLOX_GNSS::processUBXpacket(ubxPacket *msg)
37493749
// To prevent this, uncomment the line two lines below
37503750
if ((packetUBXRXMPMP != NULL) && (packetUBXRXMPMP->callbackData != NULL)
37513751
//&& (packetUBXRXMPMP->automaticFlags.flags.bits.callbackCopyValid == false) // <=== Uncomment this line to prevent new data from overwriting 'old'
3752-
)
3752+
)
37533753
{
37543754
packetUBXRXMPMP->callbackData->version = extractByte(msg, 0);
37553755
packetUBXRXMPMP->callbackData->numBytesUserData = extractInt(msg, 2);
@@ -3786,7 +3786,7 @@ void SFE_UBLOX_GNSS::processUBXpacket(ubxPacket *msg)
37863786
// To prevent this, uncomment the line two lines below
37873787
if ((packetUBXRXMPMPmessage != NULL) && (packetUBXRXMPMPmessage->callbackData != NULL)
37883788
//&& (packetUBXRXMPMPmessage->automaticFlags.flags.bits.callbackCopyValid == false) // <=== Uncomment this line to prevent new data from overwriting 'old'
3789-
)
3789+
)
37903790
{
37913791
packetUBXRXMPMPmessage->callbackData->sync1 = UBX_SYNCH_1;
37923792
packetUBXRXMPMPmessage->callbackData->sync2 = UBX_SYNCH_2;
@@ -3808,7 +3808,7 @@ void SFE_UBLOX_GNSS::processUBXpacket(ubxPacket *msg)
38083808
// Parse various byte fields into storage - but only if we have memory allocated for it
38093809
if ((packetUBXRXMCOR != NULL) && (packetUBXRXMCOR->callbackData != NULL)
38103810
//&& (packetUBXRXMCOR->automaticFlags.flags.bits.callbackCopyValid == false) // <=== Uncomment this line to prevent new data from overwriting 'old'
3811-
)
3811+
)
38123812
{
38133813
packetUBXRXMCOR->callbackData->version = extractByte(msg, 0);
38143814
packetUBXRXMCOR->callbackData->ebno = extractByte(msg, 1);
@@ -5399,34 +5399,34 @@ void SFE_UBLOX_GNSS::checkCallbacks(void)
53995399

54005400
if ((packetUBXRXMPMP != NULL) // If RAM has been allocated for message storage
54015401
&& (packetUBXRXMPMP->callbackData != NULL) // If RAM has been allocated for the copy of the data
5402-
&& (packetUBXRXMPMP->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
5402+
&& (packetUBXRXMPMP->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
54035403
&& (packetUBXRXMPMP->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
54045404
{
54055405
// if (_printDebug == true)
54065406
// _debugSerial->println(F("checkCallbacks: calling callbackPtr for RXM PMP"));
5407-
packetUBXRXMPMP->callbackPointerPtr(packetUBXRXMPMP->callbackData); // Call the callback
5407+
packetUBXRXMPMP->callbackPointerPtr(packetUBXRXMPMP->callbackData); // Call the callback
54085408
packetUBXRXMPMP->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
54095409
}
54105410

54115411
if ((packetUBXRXMPMPmessage != NULL) // If RAM has been allocated for message storage
54125412
&& (packetUBXRXMPMPmessage->callbackData != NULL) // If RAM has been allocated for the copy of the data
5413-
&& (packetUBXRXMPMPmessage->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
5413+
&& (packetUBXRXMPMPmessage->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
54145414
&& (packetUBXRXMPMPmessage->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
54155415
{
54165416
// if (_printDebug == true)
54175417
// _debugSerial->println(F("checkCallbacks: calling callbackPtr for RXM PMP message"));
54185418
packetUBXRXMPMPmessage->callbackPointerPtr(packetUBXRXMPMPmessage->callbackData); // Call the callback
5419-
packetUBXRXMPMPmessage->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
5419+
packetUBXRXMPMPmessage->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
54205420
}
54215421

54225422
if ((packetUBXRXMCOR != NULL) // If RAM has been allocated for message storage
54235423
&& (packetUBXRXMCOR->callbackData != NULL) // If RAM has been allocated for the copy of the data
5424-
&& (packetUBXRXMCOR->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
5424+
&& (packetUBXRXMCOR->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
54255425
&& (packetUBXRXMCOR->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
54265426
{
54275427
// if (_printDebug == true)
54285428
// _debugSerial->println(F("checkCallbacks: calling callbackPtr for RXM COR"));
5429-
packetUBXRXMCOR->callbackPointerPtr(packetUBXRXMCOR->callbackData); // Call the callback
5429+
packetUBXRXMCOR->callbackPointerPtr(packetUBXRXMCOR->callbackData); // Call the callback
54305430
packetUBXRXMCOR->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
54315431
}
54325432

@@ -8468,7 +8468,7 @@ bool SFE_UBLOX_GNSS::setDynamicSPARTNKey(uint8_t keyLengthBytes, uint16_t validF
84688468
}
84698469

84708470
if (ok)
8471-
ok = setDynamicSPARTNKey(keyLengthBytes, validFromWno, validFromTow, (const uint8_t *)binaryKey);
8471+
ok = setDynamicSPARTNKey(keyLengthBytes, validFromWno, validFromTow, (const uint8_t *)binaryKey);
84728472

84738473
delete[] binaryKey; // Free the memory allocated for binaryKey
84748474

@@ -8617,7 +8617,7 @@ bool SFE_UBLOX_GNSS::setDynamicSPARTNKeys(uint8_t keyLengthBytes1, uint16_t vali
86178617

86188618
if (ok)
86198619
ok = setDynamicSPARTNKeys(keyLengthBytes1, validFromWno1, validFromTow1, (const uint8_t *)binaryKey1,
8620-
keyLengthBytes2, validFromWno2, validFromTow2, (const uint8_t *)binaryKey2);
8620+
keyLengthBytes2, validFromWno2, validFromTow2, (const uint8_t *)binaryKey2);
86218621

86228622
delete[] binaryKey1; // Free the memory allocated for binaryKey1
86238623
delete[] binaryKey2; // Free the memory allocated for binaryKey2
@@ -11801,7 +11801,7 @@ bool SFE_UBLOX_GNSS::initPacketUBXNAVSVIN()
1180111801
void SFE_UBLOX_GNSS::flushNAVSVIN()
1180211802
{
1180311803
if (packetUBXNAVSVIN == NULL)
11804-
return; // Bail if RAM has not been allocated (otherwise we could be writing anywhere!)
11804+
return; // Bail if RAM has not been allocated (otherwise we could be writing anywhere!)
1180511805
packetUBXNAVSVIN->moduleQueried.moduleQueried.all = 0; // Mark all datums as stale (read before)
1180611806
}
1180711807

@@ -15980,11 +15980,11 @@ uint8_t SFE_UBLOX_GNSS::getNavigationFrequency(uint16_t maxWait)
1598015980

1598115981
if (measurementRate == 0)
1598215982
{
15983-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
15984-
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
15985-
_debugSerial->println(F("getNavigationFrequency: zero measRate!"));
15986-
#endif
15987-
return(0); // Avoid divide-by-zero error
15983+
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
15984+
if ((_printDebug == true) || (_printLimitedDebug == true)) // This is important. Print this if doing limited debugging
15985+
_debugSerial->println(F("getNavigationFrequency: zero measRate!"));
15986+
#endif
15987+
return (0); // Avoid divide-by-zero error
1598815988
}
1598915989

1599015990
measurementRate = 1000 / measurementRate; // This may return an int when it's a float, but I'd rather not return 4 bytes
@@ -16386,16 +16386,16 @@ uint32_t SFE_UBLOX_GNSS::getUnixEpoch(uint16_t maxWait)
1638616386
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.min = false;
1638716387
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.sec = false;
1638816388
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
16389-
uint32_t t = SFE_UBLOX_DAYS_FROM_1970_TO_2020; // Jan 1st 2020 as days from Jan 1st 1970
16390-
t += (uint32_t)SFE_UBLOX_DAYS_SINCE_2020[packetUBXNAVPVT->data.year - 2020]; // Add on the number of days since 2020
16389+
uint32_t t = SFE_UBLOX_DAYS_FROM_1970_TO_2020; // Jan 1st 2020 as days from Jan 1st 1970
16390+
t += (uint32_t)SFE_UBLOX_DAYS_SINCE_2020[packetUBXNAVPVT->data.year - 2020]; // Add on the number of days since 2020
1639116391
t += (uint32_t)SFE_UBLOX_DAYS_SINCE_MONTH[packetUBXNAVPVT->data.year % 4 == 0 ? 0 : 1][packetUBXNAVPVT->data.month - 1]; // Add on the number of days since Jan 1st
16392-
t += (uint32_t)packetUBXNAVPVT->data.day - 1; // Add on the number of days since the 1st of the month
16393-
t *= 24; // Convert to hours
16394-
t += (uint32_t)packetUBXNAVPVT->data.hour; // Add on the hour
16395-
t *= 60; // Convert to minutes
16396-
t += (uint32_t)packetUBXNAVPVT->data.min; // Add on the minute
16397-
t *= 60; // Convert to seconds
16398-
t += (uint32_t)packetUBXNAVPVT->data.sec; // Add on the second
16392+
t += (uint32_t)packetUBXNAVPVT->data.day - 1; // Add on the number of days since the 1st of the month
16393+
t *= 24; // Convert to hours
16394+
t += (uint32_t)packetUBXNAVPVT->data.hour; // Add on the hour
16395+
t *= 60; // Convert to minutes
16396+
t += (uint32_t)packetUBXNAVPVT->data.min; // Add on the minute
16397+
t *= 60; // Convert to seconds
16398+
t += (uint32_t)packetUBXNAVPVT->data.sec; // Add on the second
1639916399
return t;
1640016400
}
1640116401

@@ -16417,23 +16417,23 @@ uint32_t SFE_UBLOX_GNSS::getUnixEpoch(uint32_t &microsecond, uint16_t maxWait)
1641716417
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.sec = false;
1641816418
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.nano = false;
1641916419
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
16420-
uint32_t t = SFE_UBLOX_DAYS_FROM_1970_TO_2020; // Jan 1st 2020 as days from Jan 1st 1970
16421-
t += (uint32_t)SFE_UBLOX_DAYS_SINCE_2020[packetUBXNAVPVT->data.year - 2020]; // Add on the number of days since 2020
16420+
uint32_t t = SFE_UBLOX_DAYS_FROM_1970_TO_2020; // Jan 1st 2020 as days from Jan 1st 1970
16421+
t += (uint32_t)SFE_UBLOX_DAYS_SINCE_2020[packetUBXNAVPVT->data.year - 2020]; // Add on the number of days since 2020
1642216422
t += (uint32_t)SFE_UBLOX_DAYS_SINCE_MONTH[packetUBXNAVPVT->data.year % 4 == 0 ? 0 : 1][packetUBXNAVPVT->data.month - 1]; // Add on the number of days since Jan 1st
16423-
t += (uint32_t)packetUBXNAVPVT->data.day - 1; // Add on the number of days since the 1st of the month
16424-
t *= 24; // Convert to hours
16425-
t += (uint32_t)packetUBXNAVPVT->data.hour; // Add on the hour
16426-
t *= 60; // Convert to minutes
16427-
t += (uint32_t)packetUBXNAVPVT->data.min; // Add on the minute
16428-
t *= 60; // Convert to seconds
16429-
t += (uint32_t)packetUBXNAVPVT->data.sec; // Add on the second
16430-
int32_t us = packetUBXNAVPVT->data.nano / 1000; // Convert nanos to micros
16431-
microsecond = (uint32_t)us; // Could be -ve!
16423+
t += (uint32_t)packetUBXNAVPVT->data.day - 1; // Add on the number of days since the 1st of the month
16424+
t *= 24; // Convert to hours
16425+
t += (uint32_t)packetUBXNAVPVT->data.hour; // Add on the hour
16426+
t *= 60; // Convert to minutes
16427+
t += (uint32_t)packetUBXNAVPVT->data.min; // Add on the minute
16428+
t *= 60; // Convert to seconds
16429+
t += (uint32_t)packetUBXNAVPVT->data.sec; // Add on the second
16430+
int32_t us = packetUBXNAVPVT->data.nano / 1000; // Convert nanos to micros
16431+
microsecond = (uint32_t)us; // Could be -ve!
1643216432
// Adjust t if nano is negative
1643316433
if (us < 0)
1643416434
{
1643516435
microsecond = (uint32_t)(us + 1000000); // Make nano +ve
16436-
t--; // Decrement t by 1 second
16436+
t--; // Decrement t by 1 second
1643716437
}
1643816438
return t;
1643916439
}

src/SparkFun_u-blox_GNSS_Arduino_Library.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,14 +1110,14 @@ class SFE_UBLOX_GNSS
11101110
void flushNAVCLOCK(); // Mark all the data as read/stale
11111111
void logNAVCLOCK(bool enabled = true); // Log data to file buffer
11121112

1113-
bool getSurveyStatus(uint16_t maxWait = 2100); // NAV SVIN - Reads survey in status
1114-
bool setAutoNAVSVIN(bool enabled, uint16_t maxWait = defaultMaxWait); // Enable/disable automatic survey in reports at the navigation frequency
1115-
bool setAutoNAVSVIN(bool enabled, bool implicitUpdate, uint16_t maxWait = defaultMaxWait); // Enable/disable automatic survey in reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
1116-
bool setAutoNAVSVINrate(uint8_t rate, bool implicitUpdate = true, uint16_t maxWait = defaultMaxWait); // Set the rate for automatic SVIN reports
1117-
bool setAutoNAVSVINcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_SVIN_data_t *), uint16_t maxWait = defaultMaxWait); // Enable automatic SVIN reports at the navigation frequency. Data is accessed from the callback.
1118-
bool assumeAutoNAVSVIN(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and survey in is send cyclically already
1119-
void flushNAVSVIN(); // Mark all the data as read/stale
1120-
void logNAVSVIN(bool enabled = true); // Log data to file buffer
1113+
bool getSurveyStatus(uint16_t maxWait = 2100); // NAV SVIN - Reads survey in status
1114+
bool setAutoNAVSVIN(bool enabled, uint16_t maxWait = defaultMaxWait); // Enable/disable automatic survey in reports at the navigation frequency
1115+
bool setAutoNAVSVIN(bool enabled, bool implicitUpdate, uint16_t maxWait = defaultMaxWait); // Enable/disable automatic survey in reports at the navigation frequency, with implicitUpdate == false accessing stale data will not issue parsing of data in the rxbuffer of your interface, instead you have to call checkUblox when you want to perform an update
1116+
bool setAutoNAVSVINrate(uint8_t rate, bool implicitUpdate = true, uint16_t maxWait = defaultMaxWait); // Set the rate for automatic SVIN reports
1117+
bool setAutoNAVSVINcallbackPtr(void (*callbackPointerPtr)(UBX_NAV_SVIN_data_t *), uint16_t maxWait = defaultMaxWait); // Enable automatic SVIN reports at the navigation frequency. Data is accessed from the callback.
1118+
bool assumeAutoNAVSVIN(bool enabled, bool implicitUpdate = true); // In case no config access to the GPS is possible and survey in is send cyclically already
1119+
void flushNAVSVIN(); // Mark all the data as read/stale
1120+
void logNAVSVIN(bool enabled = true); // Log data to file buffer
11211121

11221122
// Add "auto" support for NAV TIMELS - to avoid needing 'global' storage
11231123
bool getLeapSecondEvent(uint16_t maxWait = defaultMaxWait); // Reads leap second event info

0 commit comments

Comments
 (0)