mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[GPS] Fix running out of memory when no GPS data is received.
The log string was extended over 80 bytes when occasional bogus data was read, but no valid NMEA sentence, thus filling up the RAM.
This commit is contained in:
@@ -78,7 +78,10 @@ bool P082_data_struct::loop() {
|
||||
--available;
|
||||
char c = easySerial->read();
|
||||
# ifdef P082_SEND_GPS_TO_LOG
|
||||
_currentSentence += c;
|
||||
if (_currentSentence.length() <= 80) {
|
||||
// No need to capture more than 80 bytes as a NMEA message is never that long.
|
||||
_currentSentence += c;
|
||||
}
|
||||
# endif // ifdef P082_SEND_GPS_TO_LOG
|
||||
|
||||
if (gps->encode(c)) {
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
# include <TinyGPS++.h>
|
||||
# include <ESPeasySerial.h>
|
||||
|
||||
|
||||
#ifndef LIMIT_BUILD_SIZE
|
||||
# define P082_SEND_GPS_TO_LOG
|
||||
#endif
|
||||
|
||||
# define P082_TIMESTAMP_AGE 1500
|
||||
# define P082_DEFAULT_FIX_TIMEOUT 2500 // TTL of fix status in ms since last update
|
||||
|
||||
Reference in New Issue
Block a user