Skip to content

Commit 6eea877

Browse files
authored
Merge pull request #124 from sparkfun/release_candidate
v2.2.4
2 parents f324b40 + e3d2c01 commit 6eea877

File tree

10 files changed

+43
-23
lines changed

10 files changed

+43
-23
lines changed

Diff for: README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,18 @@ There is a [new example](./examples/Dead_Reckoning/Example8_getNAVPVAT) showing
8080

8181
## Memory Usage
8282

83-
The u-blox GNSS library has grown considerably over the years and v2.0.8 came very close to completely filling the program memory on platforms like the ATmega328 (Arduino Uno).
84-
If you want to reduce the amount of memory used by the library, you can edit the header file (_SparkFun_u-blox_GNSS_Arduino_Library.h_) and uncomment line 60:
83+
The u-blox GNSS library has grown considerably over the years and now exceeds the available program memory on platforms like the ATmega328 (Arduino Uno).
84+
If you want to reduce the amount of memory used by the library, you can edit the header file (_SparkFun_u-blox_GNSS_Arduino_Library.h_) and uncomment lines 60 and 63:
8585

8686
```
8787
#define SFE_UBLOX_REDUCED_PROG_MEM // Uncommenting this line will delete the minor debug messages to save memory
8888
```
8989

90-
Doing this will save approximately 15% of the program memory used by the library. From v2.0.18 of the library, the debug messages are automatically deleted on ARDUINO_AVR_UNO platforms. For other platforms, you will need to uncomment that line manually.
90+
```
91+
#define SFE_UBLOX_DISABLE_AUTO_NMEA // Uncommenting this line will disable auto-NMEA support to save memory
92+
```
93+
94+
**Please note:** the debug messages are automatically deleted and auto-NMEA support is automatically disabled on ARDUINO_AVR_UNO platforms. For other platforms, you will need to uncomment those lines manually.
9195

9296
On Windows, you will normally find _SparkFun_u-blox_GNSS_Arduino_Library.h_ in:
9397
- Documents\Arduino\libraries\SparkFun_u-blox_GNSS_Arduino_Library\src

Diff for: Theory.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ In v2.0, the full list of messages which can be processed and logged automatical
5656
- UBX-NAV-HPPOSLLH (0x01 0x14): High precision geodetic position solution
5757
- UBX-NAV-PVAT (0x01 0x17): Navigation position velocity attitude time solution (**only with ADR or UDR products**)
5858
- UBX-NAV-CLOCK (0x01 0x22): Clock solution
59+
- UBX-NAV-SAT (0x01 0x35): Satellite information
5960
- UBX-NAV-SVIN (0x01 0x3B): Survey-in data (**only with High Precision GNSS products**)
6061
- UBX-NAV-RELPOSNED (0x01 0x3C): Relative positioning information in NED frame (**only with High Precision GNSS products**)
6162
- UBX-NAV-AOPSTATUS (0x01 0x60): AssistNow Autonomous status

Diff for: examples/Automatic_NMEA/Example1_getLatestNMEAGPGGA/Example1_getLatestNMEAGPGGA.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
Get the GPGGA NMEA sentence using getLatestNMEAGPGGA
33
By: Paul Clark
44
SparkFun Electronics
5-
Date: January 12th, 2021
5+
Date: January 12th, 2022
66
License: MIT. See license file for more information but you can
77
basically do whatever you want with this code.
88
9+
** Please note: this example will not run on Arduino Uno. See https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/blob/main/README.md#memory-usage
10+
911
This example shows how to turn on/off the NMEA sentences being output over I2C.
1012
It then demonstrates how to use the new getLatestNMEAGPGGA function to retrieve the latest GPGGA message.
1113
getLatestNMEAGPGGA returns immediately - it is not blocking.

Diff for: examples/Automatic_NMEA/Example2_NMEA_GGA_Callbacks/Example2_NMEA_GGA_Callbacks.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
Get the latest GPGGA / GNGGA NMEA sentence using callbacks
33
By: Paul Clark
44
SparkFun Electronics
5-
Date: January 12th, 2021
5+
Date: January 12th, 2022
66
License: MIT. See license file for more information but you can
77
basically do whatever you want with this code.
88
9+
** Please note: this example will not run on Arduino Uno. See https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/blob/main/README.md#memory-usage
10+
911
This example shows how to turn on/off the NMEA sentences being output over I2C.
1012
It then demonstrates how to get the latest GPGGA or GNGGA message autonomously using callbacks.
1113

Diff for: examples/Automatic_NMEA/Example3_getLatestNMEA_GPGGA-VTG-RMC-ZDA/Example3_getLatestNMEA_GPGGA-VTG-RMC-ZDA.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
Get the NMEA sentence using getLatestNMEAGPxxx (GGA, VTG, RMC, ZDA)
33
By: Paul Clark
44
SparkFun Electronics
5-
Date: March 2nd, 2021
5+
Date: March 2nd, 2022
66
License: MIT. See license file for more information but you can
77
basically do whatever you want with this code.
88
9+
** Please note: this example will not run on Arduino Uno. See https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/blob/main/README.md#memory-usage
10+
911
This example shows how to turn on/off the NMEA sentences being output over I2C.
1012
It then demonstrates how to use the new getLatestNMEAGPxxx function to retrieve the latest GPGGA message.
1113
getLatestNMEAGPxxx returns immediately - it is not blocking.

Diff for: examples/Automatic_NMEA/Example4_NMEA_GGA_VTG_RMC_ZDA_Callbacks/Example4_NMEA_GGA_VTG_RMC_ZDA_Callbacks.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
Get the latest GGA, VTG, RMC, ZDA NMEA sentence using callbacks
33
By: Paul Clark
44
SparkFun Electronics
5-
Date: March 2nd, 2021
5+
Date: March 2nd, 2022
66
License: MIT. See license file for more information but you can
77
basically do whatever you want with this code.
88
9+
** Please note: this example will not run on Arduino Uno. See https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/blob/main/README.md#memory-usage
10+
911
This example shows how to turn on/off the NMEA sentences being output over I2C.
1012
It then demonstrates how to get the latest GGA, VTG, RMC or ZDA message autonomously using callbacks.
1113

Diff for: examples/Example29_JammingInformation/Example29_JammingInformation.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Get the jamming state and indication
33
By: Paul Clark
44
SparkFun Electronics
5-
Date: March 2nd, 2021
5+
Date: March 2nd, 2022
66
License: MIT. See license file for more information but you can
77
basically do whatever you want with this code.
88
@@ -73,7 +73,7 @@ void loop()
7373

7474
if (myGNSS.getHWstatus(&hwStatus)) // Read the hardware status
7575
{
76-
Serial.println(F("Hardware status (UBX_MON_RF):"));
76+
Serial.println(F("Hardware status (UBX_MON_HW):"));
7777

7878
Serial.print(F("Jamming state: "));
7979
Serial.print(hwStatus.flags.bits.jammingState);

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.2.3
2+
version=2.2.4
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules<br/><br/>

Diff for: src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void SFE_UBLOX_GNSS::end(void)
422422
packetUBXHNRPVT = NULL; // Redundant?
423423
}
424424

425-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
425+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
426426
if (storageNMEAGPGGA != NULL)
427427
{
428428
if (storageNMEAGPGGA->callbackCopy != NULL)
@@ -1863,7 +1863,7 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
18631863
_signsOfLife = isNMEAHeaderValid();
18641864
}
18651865

1866-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
1866+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
18671867
// Check if we have automatic storage for this message
18681868
if (isThisNMEAauto())
18691869
{
@@ -1902,7 +1902,7 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
19021902

19031903
if ((nmeaByteCounter > 5) || (nmeaByteCounter < 0)) // Should we add incoming to the file buffer and/or pass it to processNMEA?
19041904
{
1905-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
1905+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
19061906
if (isThisNMEAauto())
19071907
{
19081908
uint8_t *lengthPtr = getNMEAWorkingLengthPtr(); // Get a pointer to the working copy length
@@ -1938,7 +1938,7 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
19381938

19391939
if (nmeaByteCounter == 0) // Check if we are done
19401940
{
1941-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
1941+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
19421942
if (isThisNMEAauto())
19431943
{
19441944
uint8_t *workingLengthPtr = getNMEAWorkingLengthPtr(); // Get a pointer to the working copy length
@@ -2194,7 +2194,7 @@ void SFE_UBLOX_GNSS::processNMEA(char incoming)
21942194
_nmeaOutputPort->write(incoming); // Echo this byte to the serial port
21952195
}
21962196

2197-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
2197+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
21982198
// Check if the NMEA message (in nmeaAddressField) is "auto" (i.e. has RAM allocated for it)
21992199
bool SFE_UBLOX_GNSS::isThisNMEAauto()
22002200
{
@@ -5568,7 +5568,7 @@ void SFE_UBLOX_GNSS::checkCallbacks(void)
55685568
packetUBXHNRPVT->automaticFlags.flags.bits.callbackCopyValid = false; // Mark the data as stale
55695569
}
55705570

5571-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
5571+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
55725572
if ((storageNMEAGPGGA != NULL) // If RAM has been allocated for message storage
55735573
&& (storageNMEAGPGGA->callbackCopy != NULL) // If RAM has been allocated for the copy of the data
55745574
&& (storageNMEAGPGGA->automaticFlags.flags.bits.callbackCopyValid == 1)) // If the copy of the data is valid
@@ -14818,7 +14818,7 @@ uint32_t SFE_UBLOX_GNSS::getProcessNMEAMask()
1481814818
return (_processNMEA.all);
1481914819
}
1482014820

14821-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
14821+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
1482214822
// Initiate automatic storage of NMEA GPGGA messages
1482314823

1482414824
// Get the most recent GPGGA message

Diff for: src/SparkFun_u-blox_GNSS_Arduino_Library.h

+13-6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,19 @@
5757
#include "u-blox_structs.h"
5858

5959
// Uncomment the next line (or add SFE_UBLOX_REDUCED_PROG_MEM as a compiler directive) to reduce the amount of program memory used by the library
60-
//#define SFE_UBLOX_REDUCED_PROG_MEM // Uncommenting this line will delete the minor debug messages and disable auto-NMEA support to save memory
60+
//#define SFE_UBLOX_REDUCED_PROG_MEM // Uncommenting this line will delete the minor debug messages to save memory
6161

62-
// The code just about fills the program memory on the ATmega328P (Arduino Uno), so let's delete the minor debug messages and disable auto-NMEA support anyway
63-
#if !defined(SFE_UBLOX_REDUCED_PROG_MEM) && defined(ARDUINO_ARCH_AVR)
62+
// Uncomment the next line (or add SFE_UBLOX_DISABLE_AUTO_NMEA as a compiler directive) to reduce the amount of program memory used by the library
63+
//#define SFE_UBLOX_DISABLE_AUTO_NMEA // Uncommenting this line will disable auto-NMEA support to save memory
64+
65+
// The code exceeds the program memory on the ATmega328P (Arduino Uno), so let's delete the minor debug messages and disable auto-NMEA support anyway
66+
// However, the ATmega2560 and ATmega1280 _do_ have enough memory, so let's exclude those
67+
#if !defined(SFE_UBLOX_REDUCED_PROG_MEM) && defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_AVR_MEGA2560) && !defined(ARDUINO_AVR_MEGA) && !defined(ARDUINO_AVR_ADK)
6468
#define SFE_UBLOX_REDUCED_PROG_MEM
6569
#endif
70+
#if !defined(SFE_UBLOX_DISABLE_AUTO_NMEA) && defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_AVR_MEGA2560) && !defined(ARDUINO_AVR_MEGA) && !defined(ARDUINO_AVR_ADK)
71+
#define SFE_UBLOX_DISABLE_AUTO_NMEA
72+
#endif
6673

6774
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6875

@@ -1431,7 +1438,7 @@ class SFE_UBLOX_GNSS
14311438
void setProcessNMEAMask(uint32_t messages = SFE_UBLOX_FILTER_NMEA_ALL); // Control which NMEA messages are passed to processNMEA. Default to passing ALL messages
14321439
uint32_t getProcessNMEAMask(); // Return which NMEA messages are passed to processNMEA
14331440

1434-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
1441+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
14351442
// Support for "auto" storage of NMEA messages
14361443
uint8_t getLatestNMEAGPGGA(NMEA_GGA_data_t *data); // Return the most recent GPGGA: 0 = no data, 1 = stale data, 2 = fresh data
14371444
bool setNMEAGPGGAcallback(void (*callbackPointer)(NMEA_GGA_data_t)); // Enable a callback on the arrival of a GPGGA message
@@ -1513,7 +1520,7 @@ class SFE_UBLOX_GNSS
15131520
UBX_MGA_ACK_DATA0_t *packetUBXMGAACK = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15141521
UBX_MGA_DBD_t *packetUBXMGADBD = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15151522

1516-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
1523+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
15171524
NMEA_GPGGA_t *storageNMEAGPGGA = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15181525
NMEA_GNGGA_t *storageNMEAGNGGA = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
15191526
NMEA_GPVTG_t *storageNMEAGPVTG = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
@@ -1606,7 +1613,7 @@ class SFE_UBLOX_GNSS
16061613
bool initPacketUBXMGAACK(); // Allocate RAM for packetUBXMGAACK and initialize it
16071614
bool initPacketUBXMGADBD(); // Allocate RAM for packetUBXMGADBD and initialize it
16081615

1609-
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
1616+
#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA
16101617
bool initStorageNMEAGPGGA(); // Allocate RAM for incoming NMEA GPGGA messages and initialize it
16111618
bool initStorageNMEAGNGGA(); // Allocate RAM for incoming NMEA GNGGA messages and initialize it
16121619
bool initStorageNMEAGPVTG(); // Allocate RAM for incoming NMEA GPVTG messages and initialize it

0 commit comments

Comments
 (0)