@@ -1050,14 +1050,8 @@ const char *DevUBLOXGNSS::statusString(sfe_ublox_status_e stat)
10501050// Check for the arrival of new I2C/Serial/SPI data
10511051// Called regularly to check for available bytes on the user' specified port
10521052
1053- void DevUBLOXGNSS::lockCheckUblox(void) { if (_enableCheckUbloxLock) _checkUbloxLock = true; }
1054- void DevUBLOXGNSS::unlockCheckUblox(void) { _checkUbloxLock = false; }
1055- 
10561053bool DevUBLOXGNSS::checkUblox(uint8_t requestedClass, uint8_t requestedID)
10571054{
1058-   if (_checkUbloxLock)
1059-     return false;
1060- 
10611055  return checkUbloxInternal(&packetCfg, requestedClass, requestedID);
10621056}
10631057
@@ -1068,7 +1062,7 @@ bool DevUBLOXGNSS::checkUbloxInternal(ubxPacket *incomingUBX, uint8_t requestedC
10681062
10691063  // Update storedClass and storedID if either requestedClass or requestedID is non-zero,
10701064  // otherwise leave unchanged. This allows calls of checkUblox() (which defaults to checkUblox(0,0))
1071-   // by other threads without changing  the requested / expected Class and ID.
1065+   // by other threads without overwriting  the requested / expected Class and ID.
10721066  volatile static uint8_t storedClass = 0;
10731067  volatile static uint8_t storedID = 0;
10741068  if (requestedClass || requestedID) // If either is non-zero, store the requested Class and ID
@@ -4641,8 +4635,6 @@ void DevUBLOXGNSS::addToChecksum(uint8_t incoming)
46414635// Given a packet and payload, send everything including CRC bytes via I2C port
46424636sfe_ublox_status_e DevUBLOXGNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t maxWait, bool expectACKonly)
46434637{
4644-   lockCheckUblox();
4645- 
46464638  if (!lock()) return SFE_UBLOX_STATUS_FAIL;
46474639
46484640  sfe_ublox_status_e retVal = SFE_UBLOX_STATUS_SUCCESS;
@@ -4669,7 +4661,6 @@ sfe_ublox_status_e DevUBLOXGNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t ma
46694661      }
46704662#endif
46714663      unlock();
4672-       unlockCheckUblox();
46734664      return retVal;
46744665    }
46754666  }
@@ -4713,8 +4704,6 @@ sfe_ublox_status_e DevUBLOXGNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t ma
47134704    processSpiBuffer(&packetCfg, 0, 0); // Process any SPI data received during the sendSpiCommand - but only if not checking for a response
47144705  }
47154706
4716-   unlockCheckUblox();
4717- 
47184707  return retVal;
47194708}
47204709
0 commit comments