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

Commit 61ab2e9

Browse files
committed
Reduced RAM footprint back to 128. Added example calls in sketch to demo how to write to memory layers.
1 parent 8063fd1 commit 61ab2e9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

examples/ZED-F9P/Example10_multiSetVal/Example10_multiSetVal.ino

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
2929
SFE_UBLOX_GPS myGPS;
3030

31-
long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to Ublox module.
32-
3331
void setup()
3432
{
3533
Serial.begin(115200);
@@ -56,17 +54,19 @@ void setup()
5654
//L, U1, I1, E1 and X1 values are 8-bit
5755
//U2, I2, E2 and X2 values are 16-bit
5856
//U4, I4, R4, E4, X4 values are 32-bit
59-
57+
6058
setValueSuccess &= myGPS.setVal8(0x10930006, 0); //Enable high precision NMEA (value is 8-bit (L / U1))
61-
//setValueSuccess &= myGPS.setVal16(0x30210001, 100); //Set measurement rate to 100ms (10Hz update rate) (value is 16-bit (U2))
59+
//setValueSuccess &= myGPS.setVal16(0x30210001, 200); //Set measurement rate to 100ms (10Hz update rate) (value is 16-bit (U2))
60+
//setValueSuccess &= myGPS.setVal16(0x30210001, 200, 1); //Set rate setting in RAM instead of BBR
6261
setValueSuccess &= myGPS.setVal16(0x30210001, 1000); //Set measurement rate to 1000ms (1Hz update rate) (value is 16-bit (U2))
6362

6463
//Below is the original way we enabled a single RTCM message on the I2C port. After that, we show how to do the same
6564
//but with multiple messages all in one go using newCfgValset, addCfgValset and sendCfgValset.
6665
//Original: myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second
67-
66+
6867
//Begin with newCfgValset8/16/32
6968
setValueSuccess &= myGPS.newCfgValset8(0x209102bd, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1))
69+
//setValueSuccess &= myGPS.newCfgValset8(0x209102bd, 1, 7); //Set this and the following settings into Flash/RAM/BBR instead of BBR
7070
//Add extra keyIDs and values using addCfgValset8/16/32
7171
setValueSuccess &= myGPS.addCfgValset8(0x209102cc, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1))
7272
setValueSuccess &= myGPS.addCfgValset8(0x209102d1, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1))
@@ -75,13 +75,12 @@ void setup()
7575
// Add the final value and send the packet using sendCfgValset8/16/32
7676
setValueSuccess &= myGPS.sendCfgValset8(0x20910303, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1))
7777

78-
if(setValueSuccess == true)
78+
if (setValueSuccess == true)
7979
{
8080
Serial.println("Values were successfully set");
8181
}
8282
else
8383
Serial.println("Value set failed");
84-
8584
}
8685

8786
void loop()

src/SparkFun_Ublox_Arduino_Library.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ const uint8_t VAL_ID_I2C_ADDRESS = 0x01;
174174

175175
#ifndef MAX_PAYLOAD_SIZE
176176

177-
#define MAX_PAYLOAD_SIZE 768 //Worst case: UBX_CFG_VALSET packet with 64 keyIDs each with 64 bit values
177+
#define MAX_PAYLOAD_SIZE 128
178+
//#define MAX_PAYLOAD_SIZE 768 //Worst case: UBX_CFG_VALSET packet with 64 keyIDs each with 64 bit values
178179

179180
#endif
180181

0 commit comments

Comments
 (0)