Skip to content

Commit ddea771

Browse files
committed
Meters -> metres & correct setting of value
1 parent 1a3ffed commit ddea771

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8202,7 +8202,7 @@ bool SFE_UBLOX_GNSS::setupPowerMode(sfe_ublox_rxm_mode_e mode, uint16_t maxWait)
82028202

82038203
// Change the Position Accuracy using UBX-CFG-NAV5
82048204
// Value provided in meters
8205-
bool SFE_UBLOX_GNSS::setNAV5PositionAccuracy(uint16_t meters, uint16_t maxWait)
8205+
bool SFE_UBLOX_GNSS::setNAV5PositionAccuracy(uint16_t metres, uint16_t maxWait)
82068206
{
82078207
packetCfg.cls = UBX_CLASS_CFG;
82088208
packetCfg.id = UBX_CFG_NAV5;
@@ -8213,9 +8213,9 @@ bool SFE_UBLOX_GNSS::setNAV5PositionAccuracy(uint16_t meters, uint16_t maxWait)
82138213
if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
82148214
return (false);
82158215

8216-
payloadCfg[0] = 0x10; // mask: set only the posMark
8217-
payloadCfg[1] = 0x00; // mask
8218-
payloadCfg[18] = meters;
8216+
payloadCfg[0] |= 0x10; // mask: set the posMark, leave other bits unchanged
8217+
payloadCfg[18] = metres & 0xFF;
8218+
payloadCfg[19] = metres >> 8;
82198219

82208220
packetCfg.len = 36;
82218221
packetCfg.startingSpot = 0;

src/SparkFun_u-blox_GNSS_Arduino_Library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ class SFE_UBLOX_GNSS
951951
uint8_t getDynamicModel(uint16_t maxWait = defaultMaxWait); // Get the dynamic model - returns 255 if the sendCommand fails
952952

953953
// Change the position accuracy using UBX-CFG-NAV5
954-
bool setNAV5PositionAccuracy(uint16_t meters = 100, uint16_t maxWait = defaultMaxWait);
954+
bool setNAV5PositionAccuracy(uint16_t metres = 100, uint16_t maxWait = defaultMaxWait);
955955
uint16_t getNAV5PositionAccuracy(uint16_t maxWait = defaultMaxWait); // Get the position accuracy - returns 0 if the sendCommand fails
956956

957957

0 commit comments

Comments
 (0)