Skip to content

Commit 7005b05

Browse files
authored
Merge pull request #190 from hybridOL/Improve_GNSS
Improve single gnss enable/check
2 parents 6395e8f + 41a8ca6 commit 7005b05

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -8293,6 +8293,7 @@ bool SFE_UBLOX_GNSS::enableGNSS(bool enable, sfe_ublox_gnss_ids_e id, uint16_t m
82938293
payloadCfg[(block * 8) + 4 + 4] |= 0x01; // Set the enable bit in flags (Little Endian)
82948294
else
82958295
payloadCfg[(block * 8) + 4 + 4] &= 0xFE; // Clear the enable bit in flags (Little Endian)
8296+
break;
82968297
}
82978298
}
82988299

@@ -8310,8 +8311,6 @@ bool SFE_UBLOX_GNSS::isGNSSenabled(sfe_ublox_gnss_ids_e id, uint16_t maxWait)
83108311
if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
83118312
return (false);
83128313

8313-
bool retVal = false;
8314-
83158314
uint8_t numConfigBlocks = payloadCfg[3]; // Extract the numConfigBlocks
83168315

83178316
for (uint8_t block = 0; block < numConfigBlocks; block++) // Check each configuration block
@@ -8320,11 +8319,11 @@ bool SFE_UBLOX_GNSS::isGNSSenabled(sfe_ublox_gnss_ids_e id, uint16_t maxWait)
83208319
{
83218320
// We have a match so check the enable bit in flags
83228321
if ((payloadCfg[(block * 8) + 4 + 4] & 0x01) > 0) // Check the enable bit in flags (Little Endian)
8323-
retVal = true;
8322+
return true;
83248323
}
83258324
}
83268325

8327-
return (retVal);
8326+
return false;
83288327
}
83298328

83308329
// Reset ESF automatic IMU-mount alignment

0 commit comments

Comments
 (0)