Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit dec6ebe

Browse files
committed
Correcting enableGNSS. Doh!
1 parent d3da067 commit dec6ebe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,8 +4179,8 @@ boolean SFE_UBLOX_GPS::resetOdometer(uint16_t maxWait)
41794179
//Enable/Disable individual GNSS systems using UBX-CFG-GNSS
41804180
boolean SFE_UBLOX_GPS::enableGNSS(boolean enable, sfe_ublox_gnss_ids_e id, uint16_t maxWait)
41814181
{
4182-
packetCfg.cls = UBX_CLASS_NAV;
4183-
packetCfg.id = UBX_NAV_RESETODO;
4182+
packetCfg.cls = UBX_CLASS_CFG;
4183+
packetCfg.id = UBX_CFG_GNSS;
41844184
packetCfg.len = 0;
41854185
packetCfg.startingSpot = 0;
41864186

@@ -4189,15 +4189,15 @@ boolean SFE_UBLOX_GPS::enableGNSS(boolean enable, sfe_ublox_gnss_ids_e id, uint1
41894189

41904190
uint8_t numConfigBlocks = payloadCfg[3]; // Extract the numConfigBlocks
41914191

4192-
for (uint8_t id = 0; id < numConfigBlocks; id++) // Check each configuration block
4192+
for (uint8_t block = 0; block < numConfigBlocks; block++) // Check each configuration block
41934193
{
4194-
if (payloadCfg[(id * 8) + 4] == (uint8_t)id) // Check the gnssId for this block. Do we have a match?
4194+
if (payloadCfg[(block * 8) + 4] == (uint8_t)id) // Check the gnssId for this block. Do we have a match?
41954195
{
41964196
// We have a match so set/clear the enable bit in flags
41974197
if (enable)
4198-
payloadCfg[(id * 8) + 4 + 4] |= 0x01; // Set the enable bit in flags (Little Endian)
4198+
payloadCfg[(block * 8) + 4 + 4] |= 0x01; // Set the enable bit in flags (Little Endian)
41994199
else
4200-
payloadCfg[(id * 8) + 4 + 4] &= 0xFE; // Clear the enable bit in flags (Little Endian)
4200+
payloadCfg[(block * 8) + 4 + 4] &= 0xFE; // Clear the enable bit in flags (Little Endian)
42014201
}
42024202
}
42034203

0 commit comments

Comments
 (0)