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

Commit 48105d3

Browse files
authored
Merge pull request #84 from sparkfun/Correct_layers_for_getVal8
Corrected the layer in getVal8
2 parents e061d73 + 4cca836 commit 48105d3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,19 @@ uint8_t SFE_UBLOX_GPS::getVal8(uint32_t key, uint8_t layer, uint16_t maxWait)
13471347
for (uint8_t x = 0; x < packetCfg.len; x++)
13481348
packetCfg.payload[x] = 0;
13491349

1350+
//VALGET uses different memory layer definitions to VALSET
1351+
//because it can only return the value for one layer.
1352+
//So we need to fiddle the layer here.
1353+
//And just to complicate things further, the ZED-F9P only responds
1354+
//correctly to layer 0 (RAM) and layer 7 (Default)!
1355+
uint8_t getLayer = 7; // 7 is the "Default Layer"
1356+
if ((layer & VAL_LAYER_RAM) == VAL_LAYER_RAM) // Did the user request the RAM layer?
1357+
{
1358+
getLayer = 0; // Layer 0 is RAM
1359+
}
1360+
13501361
payloadCfg[0] = 0; //Message Version - set to 0
1351-
payloadCfg[1] = layer; //By default we ask for the BBR layer
1362+
payloadCfg[1] = getLayer; //Layer
13521363

13531364
//Load key into outgoing payload
13541365
payloadCfg[4] = key >> 8 * 0; //Key LSB

0 commit comments

Comments
 (0)