Skip to content

Commit f1f7a7f

Browse files
authored
Merge pull request #55 from sparkfun/release_candidate
v2.0.10
2 parents 46c1855 + 3927a9f commit f1f7a7f

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

Diff for: examples/Example20_SendCustomCommand/Example20_SendCustomCommand.ino

+7-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ void setup()
6262
// Let's configure the module's navigation rate as if we were using setNavigationFrequency
6363

6464
// Let's create our custom packet
65-
uint8_t customPayload[MAX_PAYLOAD_SIZE]; // This array holds the payload data bytes
65+
uint8_t customPayload[MAX_PAYLOAD_SIZE]; // This array holds the payload data bytes. MAX_PAYLOAD_SIZE defaults to 256. The CFG_RATE payload is only 6 bytes!
66+
67+
// setPacketCfgPayloadSize tells the library how many bytes our customPayload can hold.
68+
// It is more memory-efficient to call setPacketCfgPayloadSize before .begin (to avoid creating a new buffer, copying across
69+
// the contents of the old buffer and then deleting the old buffer). But let's call it here just to prove that we can.
70+
myGNSS.setPacketCfgPayloadSize(MAX_PAYLOAD_SIZE);
71+
6672
// The next line creates and initialises the packet information which wraps around the payload
6773
ubxPacket customCfg = {0, 0, 0, 0, 0, customPayload, 0, 0, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED};
6874

Diff for: examples/Example21_ModuleInfo/Example21_ModuleInfo.ino

+14
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ void setup()
6969

7070
//myGNSS.enableDebugging(); // Uncomment this line to enable debug messages
7171

72+
// setPacketCfgPayloadSize tells the library how many bytes our customPayload can hold.
73+
// If we call it after the .begin, the library will attempt to resize the existing 256 byte payload buffer
74+
// by creating a new buffer, copying across the contents of the old buffer, and then delete the old buffer.
75+
// This uses a lot of RAM and causes the code to fail on the ATmega328P. (We are also allocating another 341 bytes for minfo.)
76+
// To keep the code ATmega328P compliant - don't call setPacketCfgPayloadSize after .begin. Call it here instead.
77+
myGNSS.setPacketCfgPayloadSize(MAX_PAYLOAD_SIZE);
78+
7279
if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port
7380
{
7481
Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing."));
@@ -119,6 +126,13 @@ boolean SFE_UBLOX_GPS_ADD::getModuleInfo(uint16_t maxWait)
119126
// Let's create our custom packet
120127
uint8_t customPayload[MAX_PAYLOAD_SIZE]; // This array holds the payload data bytes
121128

129+
// setPacketCfgPayloadSize tells the library how many bytes our customPayload can hold.
130+
// If we call it here, after the .begin, the library will attempt to resize the existing 256 byte payload buffer
131+
// by creating a new buffer, copying across the contents of the old buffer, and then delete the old buffer.
132+
// This uses a lot of RAM and causes the code to fail on the ATmega328P. (We are also allocating another 341 bytes for minfo.)
133+
// To keep the code ATmega328P compliant - don't call setPacketCfgPayloadSize here. Call it before .begin instead.
134+
//myGNSS.setPacketCfgPayloadSize(MAX_PAYLOAD_SIZE);
135+
122136
// The next line creates and initialises the packet information which wraps around the payload
123137
ubxPacket customCfg = {0, 0, 0, 0, 0, customPayload, 0, 0, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED};
124138

Diff for: examples/Example3_GetPosition/Example3_GetPosition.ino

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void setup()
4343

4444
Wire.begin();
4545

46+
//myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
47+
4648
if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port
4749
{
4850
Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing."));

Diff for: library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun u-blox GNSS Arduino Library
2-
version=2.0.9
2+
version=2.0.10
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for I2C and Serial Communication with u-blox GNSS modules<br/><br/>

0 commit comments

Comments
 (0)