Skip to content

Commit ca4c0b1

Browse files
committed
Update comments
1 parent 69c6dfa commit ca4c0b1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/u-blox_GNSS.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5825,6 +5825,7 @@ bool DevUBLOXGNSS::pushRawData(uint8_t *dataBytes, size_t numDataBytes, bool cal
58255825
return false; // Indicate to the user that there was no data to push
58265826

58275827
if (!lock()) return false;
5828+
58285829
bool ok = false;
58295830
if (_commType == COMM_TYPE_SERIAL)
58305831
{
@@ -5932,7 +5933,9 @@ bool DevUBLOXGNSS::pushRawData(uint8_t *dataBytes, size_t numDataBytes, bool cal
59325933

59335934
ok = true;
59345935
}
5936+
59355937
unlock();
5938+
59365939
return ok;
59375940
}
59385941

src/u-blox_GNSS.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,14 @@ class DevUBLOXGNSS
136136
// Flag to indicate if we are connected to UART1 or UART2
137137
// Needed to select the correct config items when enabling a periodic message
138138
bool _UART2 = false; // Default to UART1
139-
140-
// the lock / unlock functions can be used if you have multiple tasks writing to the bus.
141-
// the idea is that in a RTOS you override this class and the two functions in which you take and give a mutex.
139+
140+
// These lock / unlock functions can be used if you have multiple tasks writing to the bus.
141+
// The idea is that in a RTOS you override this class and the two functions in which you take and give a mutex.
142142
virtual bool lock(void) { return true; }
143143
virtual void unlock(void) { }
144144

145-
// A simpler lock to prevent checkUblox from being called while a sendCommand and waitForResponse is in progress
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...
146147
void lockCheckUblox(void) __attribute__((weak));
147148
void unlockCheckUblox(void) __attribute__((weak));
148149
volatile bool _checkUbloxLock = false;

0 commit comments

Comments
 (0)