From 54bbd55cf870e7d50562b79081951d13a1f576a1 Mon Sep 17 00:00:00 2001 From: PaulZC Date: Thu, 28 Apr 2022 11:35:45 +0100 Subject: [PATCH] Fix error in processUBXpacket for UBX-CFG-RATE This error explains why the measRate was sometimes being returned as zero! --- src/SparkFun_u-blox_GNSS_Arduino_Library.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp b/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp index bc4a5b7..9063b09 100644 --- a/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp +++ b/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp @@ -3959,8 +3959,7 @@ void SFE_UBLOX_GNSS::processUBXpacket(ubxPacket *msg) packetUBXCFGPRT->dataValid = true; } } - break; - if (msg->id == UBX_CFG_RATE && msg->len == UBX_CFG_RATE_LEN) + else if (msg->id == UBX_CFG_RATE && msg->len == UBX_CFG_RATE_LEN) { // Parse various byte fields into storage - but only if we have memory allocated for it if (packetUBXCFGRATE != NULL) @@ -12994,7 +12993,7 @@ bool SFE_UBLOX_GNSS::getPortSettingsInternal(uint8_t portID, uint16_t maxWait) if (result == SFE_UBLOX_STATUS_DATA_OVERWRITTEN) retVal = true; - // Now disable automatic support for CFG-RATE (see above) + // Now disable automatic support for CFG-PRT (see above) delete packetUBXCFGPRT; packetUBXCFGPRT = NULL;