|
57 | 57 | #include "u-blox_structs.h"
|
58 | 58 |
|
59 | 59 | // 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 |
61 | 61 |
|
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) |
64 | 68 | #define SFE_UBLOX_REDUCED_PROG_MEM
|
65 | 69 | #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 |
66 | 73 |
|
67 | 74 | //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
68 | 75 |
|
@@ -1431,7 +1438,7 @@ class SFE_UBLOX_GNSS
|
1431 | 1438 | void setProcessNMEAMask(uint32_t messages = SFE_UBLOX_FILTER_NMEA_ALL); // Control which NMEA messages are passed to processNMEA. Default to passing ALL messages
|
1432 | 1439 | uint32_t getProcessNMEAMask(); // Return which NMEA messages are passed to processNMEA
|
1433 | 1440 |
|
1434 |
| -#ifndef SFE_UBLOX_REDUCED_PROG_MEM |
| 1441 | +#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA |
1435 | 1442 | // Support for "auto" storage of NMEA messages
|
1436 | 1443 | uint8_t getLatestNMEAGPGGA(NMEA_GGA_data_t *data); // Return the most recent GPGGA: 0 = no data, 1 = stale data, 2 = fresh data
|
1437 | 1444 | 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
|
1513 | 1520 | UBX_MGA_ACK_DATA0_t *packetUBXMGAACK = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
|
1514 | 1521 | UBX_MGA_DBD_t *packetUBXMGADBD = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
|
1515 | 1522 |
|
1516 |
| -#ifndef SFE_UBLOX_REDUCED_PROG_MEM |
| 1523 | +#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA |
1517 | 1524 | NMEA_GPGGA_t *storageNMEAGPGGA = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
|
1518 | 1525 | NMEA_GNGGA_t *storageNMEAGNGGA = NULL; // Pointer to struct. RAM will be allocated for this if/when necessary
|
1519 | 1526 | 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
|
1606 | 1613 | bool initPacketUBXMGAACK(); // Allocate RAM for packetUBXMGAACK and initialize it
|
1607 | 1614 | bool initPacketUBXMGADBD(); // Allocate RAM for packetUBXMGADBD and initialize it
|
1608 | 1615 |
|
1609 |
| -#ifndef SFE_UBLOX_REDUCED_PROG_MEM |
| 1616 | +#ifndef SFE_UBLOX_DISABLE_AUTO_NMEA |
1610 | 1617 | bool initStorageNMEAGPGGA(); // Allocate RAM for incoming NMEA GPGGA messages and initialize it
|
1611 | 1618 | bool initStorageNMEAGNGGA(); // Allocate RAM for incoming NMEA GNGGA messages and initialize it
|
1612 | 1619 | bool initStorageNMEAGPVTG(); // Allocate RAM for incoming NMEA GPVTG messages and initialize it
|
|
0 commit comments