Skip to content

Commit c024186

Browse files
committed
Revert lockCheckUblox and unlockCheckUblox
1 parent 263309c commit c024186

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

src/u-blox_GNSS.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
10561053
bool 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
46424636
sfe_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

src/u-blox_GNSS.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ class DevUBLOXGNSS
142142
virtual bool lock(void) { return true; }
143143
virtual void unlock(void) { }
144144

145-
// A simpler lock to prevent checkUblox from being called by another thread while a full sendCommand and waitForResponse is in progress.
146-
// Note: this won't prevent pushRawData from gatecrashing the party...
147-
void lockCheckUblox(void) __attribute__((weak));
148-
void unlockCheckUblox(void) __attribute__((weak));
149-
volatile bool _checkUbloxLock = false;
150-
public:
151-
volatile bool _enableCheckUbloxLock = false; // Change this to true to enable simple checkUblox locking
152-
153145
public:
154146
void connectedToUART2(bool connected = true) { _UART2 = connected; }
155147

0 commit comments

Comments
 (0)