Skip to content

Commit 25d60b1

Browse files
committed
Whitespace and formatting changes
1 parent f123e3f commit 25d60b1

File tree

2 files changed

+73
-71
lines changed

2 files changed

+73
-71
lines changed

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void SFE_UBLOX_GNSS::end(void)
345345
{
346346
if (packetUBXRXMQZSSL6message->callbackData != NULL)
347347
{
348-
delete [] packetUBXRXMQZSSL6message->callbackData;
348+
delete[] packetUBXRXMQZSSL6message->callbackData;
349349
}
350350
delete packetUBXRXMQZSSL6message;
351351
packetUBXRXMQZSSL6message = NULL; // Redundant?
@@ -1721,9 +1721,9 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
17211721
{
17221722
// Decide what type of response this is
17231723
if ((ubxFrameCounter == 0) && (incoming != UBX_SYNCH_1)) // ISO 'μ'
1724-
currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE; // Something went wrong. Reset.
1724+
currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE; // Something went wrong. Reset.
17251725
else if ((ubxFrameCounter == 1) && (incoming != UBX_SYNCH_2)) // ASCII 'b'
1726-
currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE; // Something went wrong. Reset.
1726+
currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE; // Something went wrong. Reset.
17271727
// Note to future self:
17281728
// There may be some duplication / redundancy in the next few lines as processUBX will also
17291729
// load information into packetBuf, but we'll do it here too for clarity
@@ -2028,8 +2028,8 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
20282028

20292029
nmeaByteCounter++; // Increment the byte counter
20302030

2031-
if (nmeaByteCounter == maxNMEAByteCount) // Check if we have processed too many bytes
2032-
currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE; // Something went wrong. Reset.
2031+
if (nmeaByteCounter == maxNMEAByteCount) // Check if we have processed too many bytes
2032+
currentSentence = SFE_UBLOX_SENTENCE_TYPE_NONE; // Something went wrong. Reset.
20332033

20342034
if (nmeaByteCounter == 0) // Check if we are done
20352035
{
@@ -2876,7 +2876,7 @@ nmeaAutomaticFlags *SFE_UBLOX_GNSS::getNMEAFlagsPtr()
28762876
// Byte 2: 10-bits of length of this packet including the first two-ish header bytes, + 6.
28772877
// byte 3 + 4 bits: Msg type 12 bits
28782878
// Example: D3 00 7C 43 F0 ... / 0x7C = 124+6 = 130 bytes in this packet, 0x43F = Msg type 1087
2879-
SFE_UBLOX_GNSS::sfe_ublox_sentence_types_e SFE_UBLOX_GNSS::processRTCMframe(uint8_t incoming, uint16_t * rtcmFrameCounter)
2879+
SFE_UBLOX_GNSS::sfe_ublox_sentence_types_e SFE_UBLOX_GNSS::processRTCMframe(uint8_t incoming, uint16_t *rtcmFrameCounter)
28802880
{
28812881
static uint16_t rtcmLen = 0;
28822882

@@ -3614,8 +3614,8 @@ void SFE_UBLOX_GNSS::processUBXpacket(ubxPacket *msg)
36143614
packetUBXNAVTIMEUTC->moduleQueried.moduleQueried.all = 0xFFFFFFFF;
36153615

36163616
// Check if we need to copy the data for the callback
3617-
if ((packetUBXNAVTIMEUTC->callbackData != NULL) // If RAM has been allocated for the copy of the data
3618-
&& (packetUBXNAVTIMEUTC->automaticFlags.flags.bits.callbackCopyValid == false)) // AND the data is stale
3617+
if ((packetUBXNAVTIMEUTC->callbackData != NULL) // If RAM has been allocated for the copy of the data
3618+
&& (packetUBXNAVTIMEUTC->automaticFlags.flags.bits.callbackCopyValid == false)) // AND the data is stale
36193619
{
36203620
memcpy(&packetUBXNAVTIMEUTC->callbackData->iTOW, &packetUBXNAVTIMEUTC->data.iTOW, sizeof(UBX_NAV_TIMEUTC_data_t));
36213621
packetUBXNAVTIMEUTC->automaticFlags.flags.bits.callbackCopyValid = true;
@@ -3943,8 +3943,10 @@ void SFE_UBLOX_GNSS::processUBXpacket(ubxPacket *msg)
39433943
// Note: the field positions depend on the version
39443944
{
39453945
// Full QZSSL6 message, including Class, ID and checksum
3946-
for (int ch = 0; ch < UBX_RXM_QZSSL6_NUM_CHANNELS; ch ++) {
3947-
if (0 == (packetUBXRXMQZSSL6message->automaticFlags.flags.bits.callbackCopyValid & (1 << ch))) {
3946+
for (int ch = 0; ch < UBX_RXM_QZSSL6_NUM_CHANNELS; ch++)
3947+
{
3948+
if (0 == (packetUBXRXMQZSSL6message->automaticFlags.flags.bits.callbackCopyValid & (1 << ch)))
3949+
{
39483950

39493951
packetUBXRXMQZSSL6message->callbackData[ch].sync1 = UBX_SYNCH_1;
39503952
packetUBXRXMQZSSL6message->callbackData[ch].sync2 = UBX_SYNCH_2;
@@ -5466,9 +5468,9 @@ void SFE_UBLOX_GNSS::checkCallbacks(void)
54665468
packetUBXNAVPVAT->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
54675469
}
54685470

5469-
if ((packetUBXNAVTIMEUTC != NULL) // If RAM has been allocated for message storage
5470-
&& (packetUBXNAVTIMEUTC->callbackData != NULL) // If RAM has been allocated for the copy of the data
5471-
&& (packetUBXNAVTIMEUTC->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
5471+
if ((packetUBXNAVTIMEUTC != NULL) // If RAM has been allocated for message storage
5472+
&& (packetUBXNAVTIMEUTC->callbackData != NULL) // If RAM has been allocated for the copy of the data
5473+
&& (packetUBXNAVTIMEUTC->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
54725474
{
54735475
if (packetUBXNAVTIMEUTC->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
54745476
{
@@ -5568,9 +5570,9 @@ void SFE_UBLOX_GNSS::checkCallbacks(void)
55685570
packetUBXNAVAOPSTATUS->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
55695571
}
55705572

5571-
if ((packetUBXNAVEOE != NULL) // If RAM has been allocated for message storage
5572-
&& (packetUBXNAVEOE->callbackData != NULL) // If RAM has been allocated for the copy of the data
5573-
&& (packetUBXNAVEOE->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
5573+
if ((packetUBXNAVEOE != NULL) // If RAM has been allocated for message storage
5574+
&& (packetUBXNAVEOE->callbackData != NULL) // If RAM has been allocated for the copy of the data
5575+
&& (packetUBXNAVEOE->automaticFlags.flags.bits.callbackCopyValid == true)) // If the copy of the data is valid
55745576
{
55755577
if (packetUBXNAVEOE->callbackPointerPtr != NULL) // If the pointer to the callback has been defined
55765578
{
@@ -5603,15 +5605,16 @@ void SFE_UBLOX_GNSS::checkCallbacks(void)
56035605
packetUBXRXMPMPmessage->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
56045606
}
56055607

5606-
if ((packetUBXRXMQZSSL6message != NULL) && // If RAM has been allocated for message storage
5607-
(packetUBXRXMQZSSL6message->callbackData != NULL) && // If RAM has been allocated for the copy of the data
5608-
(packetUBXRXMQZSSL6message->callbackPointerPtr != NULL)) // If the pointer to the callback has been defined
5608+
if ((packetUBXRXMQZSSL6message != NULL) && // If RAM has been allocated for message storage
5609+
(packetUBXRXMQZSSL6message->callbackData != NULL) && // If RAM has been allocated for the copy of the data
5610+
(packetUBXRXMQZSSL6message->callbackPointerPtr != NULL)) // If the pointer to the callback has been defined
56095611
{
5610-
for (int ch = 0; ch < UBX_RXM_QZSSL6_NUM_CHANNELS; ch ++) {
5612+
for (int ch = 0; ch < UBX_RXM_QZSSL6_NUM_CHANNELS; ch++)
5613+
{
56115614
if (packetUBXRXMQZSSL6message->automaticFlags.flags.bits.callbackCopyValid & (1 << ch)) // If the copy of the data is valid
56125615
{
5613-
packetUBXRXMQZSSL6message->callbackPointerPtr( &packetUBXRXMQZSSL6message->callbackData[ch] ); // Call the callback
5614-
packetUBXRXMQZSSL6message->automaticFlags.flags.bits.callbackCopyValid &= ~(1 << ch); // clear it
5616+
packetUBXRXMQZSSL6message->callbackPointerPtr(&packetUBXRXMQZSSL6message->callbackData[ch]); // Call the callback
5617+
packetUBXRXMQZSSL6message->automaticFlags.flags.bits.callbackCopyValid &= ~(1 << ch); // clear it
56155618
}
56165619
}
56175620
}
@@ -13127,7 +13130,6 @@ bool SFE_UBLOX_GNSS::initPacketUBXRXMQZSSL6message()
1312713130
return (true);
1312813131
}
1312913132

13130-
1313113133
bool SFE_UBLOX_GNSS::setRXMCORcallbackPtr(void (*callbackPointer)(UBX_RXM_COR_data_t *))
1313213134
{
1313313135
if (packetUBXRXMCOR == NULL)

src/SparkFun_u-blox_GNSS_Arduino_Library.h

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -745,12 +745,12 @@ class SFE_UBLOX_GNSS
745745

746746
// Process the incoming data
747747

748-
void process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Processes NMEA and UBX binary sentences one byte at a time
749-
void processNMEA(char incoming) __attribute__((weak)); // Given a NMEA character, do something with it. User can overwrite if desired to use something like tinyGPS or MicroNMEA libraries
750-
sfe_ublox_sentence_types_e processRTCMframe(uint8_t incoming, uint16_t * rtcmFrameCounter) __attribute__((weak)); // Monitor the incoming bytes for start and length bytes
751-
void processRTCM(uint8_t incoming) __attribute__((weak)); // Given rtcm byte, do something with it. User can overwrite if desired to pipe bytes to radio, internet, etc.
752-
void processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Given a character, file it away into the uxb packet structure
753-
void processUBXpacket(ubxPacket *msg); // Once a packet has been received and validated, identify this packet's class/id and update internal flags
748+
void process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Processes NMEA and UBX binary sentences one byte at a time
749+
void processNMEA(char incoming) __attribute__((weak)); // Given a NMEA character, do something with it. User can overwrite if desired to use something like tinyGPS or MicroNMEA libraries
750+
sfe_ublox_sentence_types_e processRTCMframe(uint8_t incoming, uint16_t *rtcmFrameCounter) __attribute__((weak)); // Monitor the incoming bytes for start and length bytes
751+
void processRTCM(uint8_t incoming) __attribute__((weak)); // Given rtcm byte, do something with it. User can overwrite if desired to pipe bytes to radio, internet, etc.
752+
void processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); // Given a character, file it away into the uxb packet structure
753+
void processUBXpacket(ubxPacket *msg); // Once a packet has been received and validated, identify this packet's class/id and update internal flags
754754

755755
// Send I2C/Serial/SPI commands to the module
756756

@@ -1552,12 +1552,12 @@ class SFE_UBLOX_GNSS
15521552
UBX_NAV_RELPOSNED_t *packetUBXNAVRELPOSNED = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15531553
UBX_NAV_AOPSTATUS_t *packetUBXNAVAOPSTATUS = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15541554

1555-
UBX_RXM_PMP_t *packetUBXRXMPMP = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1556-
UBX_RXM_PMP_message_t *packetUBXRXMPMPmessage = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1555+
UBX_RXM_PMP_t *packetUBXRXMPMP = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1556+
UBX_RXM_PMP_message_t *packetUBXRXMPMPmessage = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15571557
UBX_RXM_QZSSL6_message_t *packetUBXRXMQZSSL6message = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1558-
UBX_RXM_COR_t *packetUBXRXMCOR = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1559-
UBX_RXM_SFRBX_t *packetUBXRXMSFRBX = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1560-
UBX_RXM_RAWX_t *packetUBXRXMRAWX = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1558+
UBX_RXM_COR_t *packetUBXRXMCOR = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1559+
UBX_RXM_SFRBX_t *packetUBXRXMSFRBX = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
1560+
UBX_RXM_RAWX_t *packetUBXRXMRAWX = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15611561

15621562
UBX_CFG_PRT_t *packetUBXCFGPRT = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15631563
UBX_CFG_RATE_t *packetUBXCFGRATE = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
@@ -1626,44 +1626,44 @@ class SFE_UBLOX_GNSS
16261626

16271627
// The initPacket functions need to be private as they don't check if memory has already been allocated.
16281628
// Functions like setAutoNAVPOSECEF will check that memory has not been allocated before calling initPacket.
1629-
bool initPacketUBXNAVPOSECEF(); // Allocate RAM for packetUBXNAVPOSECEF and initialize it
1630-
bool initPacketUBXNAVSTATUS(); // Allocate RAM for packetUBXNAVSTATUS and initialize it
1631-
bool initPacketUBXNAVDOP(); // Allocate RAM for packetUBXNAVDOP and initialize it
1632-
bool initPacketUBXNAVATT(); // Allocate RAM for packetUBXNAVATT and initialize it
1633-
bool initPacketUBXNAVPVT(); // Allocate RAM for packetUBXNAVPVT and initialize it
1634-
bool initPacketUBXNAVODO(); // Allocate RAM for packetUBXNAVODO and initialize it
1635-
bool initPacketUBXNAVVELECEF(); // Allocate RAM for packetUBXNAVVELECEF and initialize it
1636-
bool initPacketUBXNAVVELNED(); // Allocate RAM for packetUBXNAVVELNED and initialize it
1637-
bool initPacketUBXNAVHPPOSECEF(); // Allocate RAM for packetUBXNAVHPPOSECEF and initialize it
1638-
bool initPacketUBXNAVHPPOSLLH(); // Allocate RAM for packetUBXNAVHPPOSLLH and initialize it
1639-
bool initPacketUBXNAVPVAT(); // Allocate RAM for packetUBXNAVPVAT and initialize it
1640-
bool initPacketUBXNAVTIMEUTC(); // Allocate RAM for packetUBXNAVTIMEUTC and initialize it
1641-
bool initPacketUBXNAVCLOCK(); // Allocate RAM for packetUBXNAVCLOCK and initialize it
1642-
bool initPacketUBXNAVTIMELS(); // Allocate RAM for packetUBXNAVTIMELS and initialize it
1643-
bool initPacketUBXNAVSVIN(); // Allocate RAM for packetUBXNAVSVIN and initialize it
1644-
bool initPacketUBXNAVSAT(); // Allocate RAM for packetUBXNAVSAT and initialize it
1645-
bool initPacketUBXNAVRELPOSNED(); // Allocate RAM for packetUBXNAVRELPOSNED and initialize it
1646-
bool initPacketUBXNAVAOPSTATUS(); // Allocate RAM for packetUBXNAVAOPSTATUS and initialize it
1647-
bool initPacketUBXNAVEOE(); // Allocate RAM for packetUBXNAVEOE and initialize it
1648-
bool initPacketUBXRXMPMP(); // Allocate RAM for packetUBXRXMPMP and initialize it
1649-
bool initPacketUBXRXMPMPmessage(); // Allocate RAM for packetUBXRXMPMPRaw and initialize it
1629+
bool initPacketUBXNAVPOSECEF(); // Allocate RAM for packetUBXNAVPOSECEF and initialize it
1630+
bool initPacketUBXNAVSTATUS(); // Allocate RAM for packetUBXNAVSTATUS and initialize it
1631+
bool initPacketUBXNAVDOP(); // Allocate RAM for packetUBXNAVDOP and initialize it
1632+
bool initPacketUBXNAVATT(); // Allocate RAM for packetUBXNAVATT and initialize it
1633+
bool initPacketUBXNAVPVT(); // Allocate RAM for packetUBXNAVPVT and initialize it
1634+
bool initPacketUBXNAVODO(); // Allocate RAM for packetUBXNAVODO and initialize it
1635+
bool initPacketUBXNAVVELECEF(); // Allocate RAM for packetUBXNAVVELECEF and initialize it
1636+
bool initPacketUBXNAVVELNED(); // Allocate RAM for packetUBXNAVVELNED and initialize it
1637+
bool initPacketUBXNAVHPPOSECEF(); // Allocate RAM for packetUBXNAVHPPOSECEF and initialize it
1638+
bool initPacketUBXNAVHPPOSLLH(); // Allocate RAM for packetUBXNAVHPPOSLLH and initialize it
1639+
bool initPacketUBXNAVPVAT(); // Allocate RAM for packetUBXNAVPVAT and initialize it
1640+
bool initPacketUBXNAVTIMEUTC(); // Allocate RAM for packetUBXNAVTIMEUTC and initialize it
1641+
bool initPacketUBXNAVCLOCK(); // Allocate RAM for packetUBXNAVCLOCK and initialize it
1642+
bool initPacketUBXNAVTIMELS(); // Allocate RAM for packetUBXNAVTIMELS and initialize it
1643+
bool initPacketUBXNAVSVIN(); // Allocate RAM for packetUBXNAVSVIN and initialize it
1644+
bool initPacketUBXNAVSAT(); // Allocate RAM for packetUBXNAVSAT and initialize it
1645+
bool initPacketUBXNAVRELPOSNED(); // Allocate RAM for packetUBXNAVRELPOSNED and initialize it
1646+
bool initPacketUBXNAVAOPSTATUS(); // Allocate RAM for packetUBXNAVAOPSTATUS and initialize it
1647+
bool initPacketUBXNAVEOE(); // Allocate RAM for packetUBXNAVEOE and initialize it
1648+
bool initPacketUBXRXMPMP(); // Allocate RAM for packetUBXRXMPMP and initialize it
1649+
bool initPacketUBXRXMPMPmessage(); // Allocate RAM for packetUBXRXMPMPRaw and initialize it
16501650
bool initPacketUBXRXMQZSSL6message(); // Allocate RAM for packetUBXRXMQZSSL6raw and initialize it
1651-
bool initPacketUBXRXMCOR(); // Allocate RAM for packetUBXRXMCOR and initialize it
1652-
bool initPacketUBXRXMSFRBX(); // Allocate RAM for packetUBXRXMSFRBX and initialize it
1653-
bool initPacketUBXRXMRAWX(); // Allocate RAM for packetUBXRXMRAWX and initialize it
1654-
bool initPacketUBXCFGPRT(); // Allocate RAM for packetUBXCFGPRT and initialize it
1655-
bool initPacketUBXCFGRATE(); // Allocate RAM for packetUBXCFGRATE and initialize it
1656-
bool initPacketUBXTIMTM2(); // Allocate RAM for packetUBXTIMTM2 and initialize it
1657-
bool initPacketUBXESFALG(); // Allocate RAM for packetUBXESFALG and initialize it
1658-
bool initPacketUBXESFSTATUS(); // Allocate RAM for packetUBXESFSTATUS and initialize it
1659-
bool initPacketUBXESFINS(); // Allocate RAM for packetUBXESFINS and initialize it
1660-
bool initPacketUBXESFMEAS(); // Allocate RAM for packetUBXESFMEAS and initialize it
1661-
bool initPacketUBXESFRAW(); // Allocate RAM for packetUBXESFRAW and initialize it
1662-
bool initPacketUBXHNRATT(); // Allocate RAM for packetUBXHNRATT and initialize it
1663-
bool initPacketUBXHNRINS(); // Allocate RAM for packetUBXHNRINS and initialize it
1664-
bool initPacketUBXHNRPVT(); // Allocate RAM for packetUBXHNRPVT and initialize it
1665-
bool initPacketUBXMGAACK(); // Allocate RAM for packetUBXMGAACK and initialize it
1666-
bool initPacketUBXMGADBD(); // Allocate RAM for packetUBXMGADBD and initialize it
1651+
bool initPacketUBXRXMCOR(); // Allocate RAM for packetUBXRXMCOR and initialize it
1652+
bool initPacketUBXRXMSFRBX(); // Allocate RAM for packetUBXRXMSFRBX and initialize it
1653+
bool initPacketUBXRXMRAWX(); // Allocate RAM for packetUBXRXMRAWX and initialize it
1654+
bool initPacketUBXCFGPRT(); // Allocate RAM for packetUBXCFGPRT and initialize it
1655+
bool initPacketUBXCFGRATE(); // Allocate RAM for packetUBXCFGRATE and initialize it
1656+
bool initPacketUBXTIMTM2(); // Allocate RAM for packetUBXTIMTM2 and initialize it
1657+
bool initPacketUBXESFALG(); // Allocate RAM for packetUBXESFALG and initialize it
1658+
bool initPacketUBXESFSTATUS(); // Allocate RAM for packetUBXESFSTATUS and initialize it
1659+
bool initPacketUBXESFINS(); // Allocate RAM for packetUBXESFINS and initialize it
1660+
bool initPacketUBXESFMEAS(); // Allocate RAM for packetUBXESFMEAS and initialize it
1661+
bool initPacketUBXESFRAW(); // Allocate RAM for packetUBXESFRAW and initialize it
1662+
bool initPacketUBXHNRATT(); // Allocate RAM for packetUBXHNRATT and initialize it
1663+
bool initPacketUBXHNRINS(); // Allocate RAM for packetUBXHNRINS and initialize it
1664+
bool initPacketUBXHNRPVT(); // Allocate RAM for packetUBXHNRPVT and initialize it
1665+
bool initPacketUBXMGAACK(); // Allocate RAM for packetUBXMGAACK and initialize it
1666+
bool initPacketUBXMGADBD(); // Allocate RAM for packetUBXMGADBD and initialize it
16671667

16681668
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
16691669
bool initStorageNMEAGPGGA(); // Allocate RAM for incoming NMEA GPGGA messages and initialize it

0 commit comments

Comments
 (0)