Skip to content

Commit 4ffee19

Browse files
committed
Change internal checkUblox to checkUbloxInternal
1 parent a9d8f39 commit 4ffee19

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/u-blox_GNSS.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4621,6 +4621,8 @@ void DevUBLOXGNSS::addToChecksum(uint8_t incoming)
46214621
// Given a packet and payload, send everything including CRC bytes via I2C port
46224622
sfe_ublox_status_e DevUBLOXGNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t maxWait, bool expectACKonly)
46234623
{
4624+
if (!lock()) return SFE_UBLOX_STATUS_FAIL;
4625+
46244626
sfe_ublox_status_e retVal = SFE_UBLOX_STATUS_SUCCESS;
46254627

46264628
calcChecksum(outgoingUBX); // Sets checksum A and B bytes of the packet
@@ -4633,7 +4635,6 @@ sfe_ublox_status_e DevUBLOXGNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t ma
46334635
}
46344636
#endif
46354637

4636-
if (!lock()) return SFE_UBLOX_STATUS_FAIL;
46374638
if (_commType == COMM_TYPE_I2C)
46384639
{
46394640
retVal = sendI2cCommand(outgoingUBX);
@@ -4656,6 +4657,7 @@ sfe_ublox_status_e DevUBLOXGNSS::sendCommand(ubxPacket *outgoingUBX, uint16_t ma
46564657
{
46574658
sendSpiCommand(outgoingUBX);
46584659
}
4660+
46594661
unlock();
46604662

46614663
if (maxWait > 0)
@@ -6050,7 +6052,7 @@ size_t DevUBLOXGNSS::pushAssistNowDataInternal(size_t offset, bool skipTime, con
60506052
bool keepGoing = true;
60516053
while (keepGoing && (millis() < (startTime + maxWait))) // Keep checking for the ACK until we time out
60526054
{
6053-
checkUblox();
6055+
checkUbloxInternal(&packetCfg, UBX_CLASS_MGA, UBX_MGA_ACK_DATA0); // Was checkUblox();
60546056
if (packetUBXMGAACK->head != packetUBXMGAACK->tail) // Does the MGA ACK ringbuffer contain any ACK's?
60556057
{
60566058
bool dataAckd = true; // Check if we've received the correct ACK
@@ -6573,7 +6575,7 @@ size_t DevUBLOXGNSS::readNavigationDatabase(uint8_t *dataBytes, size_t maxNumDat
65736575

65746576
while (keepGoing && (millis() < (startTime + maxWait)))
65756577
{
6576-
checkUblox();
6578+
checkUbloxInternal(&packetCfg, UBX_CLASS_MGA, UBX_MGA_ACK_DATA0); // Was checkUblox();
65776579

65786580
while (packetUBXMGADBD->head != packetUBXMGADBD->tail) // Does the MGA DBD ringbuffer contain any data?
65796581
{

src/u-blox_GNSS.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class DevUBLOXGNSS
140140
// the idea is that in a RTOS you override this class and the two functions in which you take and give a mutex.
141141
virtual bool lock(void) { return true; }
142142
virtual void unlock(void) { }
143+
143144
public:
144145
void connectedToUART2(bool connected = true) { _UART2 = connected; }
145146

@@ -1377,8 +1378,8 @@ class DevUBLOXGNSS
13771378
SparkFun_UBLOX_GNSS::SfePrint _ubxOutputPort; // The user can assign an output port to print UBX sentences if they wish
13781379
SparkFun_UBLOX_GNSS::SfePrint _outputPort; // The user can assign an output port to print ALL characters to if they wish
13791380
SparkFun_UBLOX_GNSS::SfePrint _debugSerial; // The stream to send debug messages to if enabled
1380-
bool _printDebug = false; // Flag to print the serial commands we are sending to the Serial port for debug
1381-
bool _printLimitedDebug = false; // Flag to print limited debug messages. Useful for I2C debugging or high navigation rates
1381+
bool _printDebug = false; // Flag to print the serial commands we are sending to the Serial port for debug
1382+
bool _printLimitedDebug = false; // Flag to print limited debug messages. Useful for I2C debugging or high navigation rates
13821383

13831384
// The packet buffers
13841385
// These are pointed at from within the ubxPacket

0 commit comments

Comments
 (0)