@@ -1650,7 +1650,7 @@ void SFE_UBLOX_GNSS::processRTCMframe(uint8_t incoming)
1650
1650
// Bytes can be piped to Serial or other interface. The consumer could be a radio or the internet (Ntrip broadcaster)
1651
1651
void SFE_UBLOX_GNSS::processRTCM (uint8_t incoming)
1652
1652
{
1653
- uint8_t ignoreMe = incoming; // Do something with incoming just to get rid of the pesky compiler warning!
1653
+ uint8_t ignoreMe = incoming; ignoreMe += 0 ; // Do something with incoming just to get rid of the pesky compiler warning!
1654
1654
1655
1655
// Radio.sendReliable((String)incoming); //An example of passing this byte to a radio
1656
1656
@@ -2934,7 +2934,7 @@ sfe_ublox_status_e SFE_UBLOX_GNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t
2934
2934
// Returns false if sensor fails to respond to I2C traffic
2935
2935
sfe_ublox_status_e SFE_UBLOX_GNSS::sendI2cCommand (ubxPacket *outgoingUBX, uint16_t maxWait)
2936
2936
{
2937
- uint16_t ignoreMe = maxWait; // Do something with maxWait just to avoid the pesky compiler warnings!
2937
+ uint16_t ignoreMe = maxWait; ignoreMe += 0 ; // Do something with maxWait just to avoid the pesky compiler warnings!
2938
2938
2939
2939
// From the integration guide:
2940
2940
// "The receiver does not provide any write access except for writing UBX and NMEA messages to the
@@ -3182,6 +3182,12 @@ void SFE_UBLOX_GNSS::sendSpiCommand(ubxPacket *outgoingUBX)
3182
3182
// Pretty prints the current ubxPacket
3183
3183
void SFE_UBLOX_GNSS::printPacket (ubxPacket *packet, bool alwaysPrintPayload)
3184
3184
{
3185
+ // Only print the payload is ignoreThisPayload is false otherwise
3186
+ // we could be printing gibberish from beyond the end of packetBuf
3187
+ // (These two lines get rid of a pesky compiler warning)
3188
+ bool printPayload = (ignoreThisPayload == false );
3189
+ printPayload |= (alwaysPrintPayload == true );
3190
+
3185
3191
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
3186
3192
if (_printDebug == true )
3187
3193
{
@@ -3216,9 +3222,7 @@ void SFE_UBLOX_GNSS::printPacket(ubxPacket *packet, bool alwaysPrintPayload)
3216
3222
_debugSerial->print (F (" Len: 0x" ));
3217
3223
_debugSerial->print (packet->len , HEX);
3218
3224
3219
- // Only print the payload is ignoreThisPayload is false otherwise
3220
- // we could be printing gibberish from beyond the end of packetBuf
3221
- if ((alwaysPrintPayload == true ) || (ignoreThisPayload == false ))
3225
+ if (printPayload)
3222
3226
{
3223
3227
_debugSerial->print (F (" Payload:" ));
3224
3228
@@ -3234,6 +3238,12 @@ void SFE_UBLOX_GNSS::printPacket(ubxPacket *packet, bool alwaysPrintPayload)
3234
3238
}
3235
3239
_debugSerial->println ();
3236
3240
}
3241
+ #else
3242
+ if (_printDebug == true )
3243
+ {
3244
+ _debugSerial->print (F (" Len: 0x" ));
3245
+ _debugSerial->print (packet->len , HEX);
3246
+ }
3237
3247
#endif
3238
3248
}
3239
3249
@@ -4297,12 +4307,15 @@ void SFE_UBLOX_GNSS::setSerialRate(uint32_t baudrate, uint8_t uartPort, uint16_t
4297
4307
#endif
4298
4308
4299
4309
sfe_ublox_status_e retVal = sendCommand (&packetCfg, maxWait);
4310
+
4300
4311
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
4301
4312
if (_printDebug == true )
4302
4313
{
4303
4314
_debugSerial->print (F (" setSerialRate: sendCommand returned: " ));
4304
4315
_debugSerial->println (statusString (retVal));
4305
4316
}
4317
+ #else
4318
+ (void )retVal; // Get rid of a pesky compiler warning!
4306
4319
#endif
4307
4320
}
4308
4321
@@ -10740,7 +10753,7 @@ uint16_t SFE_UBLOX_GNSS::getMagAcc(uint16_t maxWait)
10740
10753
// getGeoidSeparation is currently redundant. The geoid separation seems to only be provided in NMEA GGA and GNS messages.
10741
10754
int32_t SFE_UBLOX_GNSS::getGeoidSeparation (uint16_t maxWait)
10742
10755
{
10743
- uint16_t ignoreMe = maxWait; // Do something with maxWait just to get rid of the pesky compiler warning
10756
+ uint16_t ignoreMe = maxWait; ignoreMe += 0 ; // Do something with maxWait just to get rid of the pesky compiler warning
10744
10757
10745
10758
return (0 );
10746
10759
}
0 commit comments