Skip to content

Commit 1220ef2

Browse files
committed
Move logNMEA into process so it does not matter if processNMEA is overwritten
1 parent 7cdb4b0 commit 1220ef2

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

examples/Data_Logging/DataLoggingExample6_NMEA/DataLoggingExample6_NMEA.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
This example shows how to configure the u-blox GNSS to send PVT reports automatically
1010
and log those and any incoming NMEA messages to SD card in UBX format
1111
12-
** Please note: NMEA logging relies upon processNMEA **
13-
** You will not be able to log NMEA data automatically through the library if you overwrite processNMEA with your own function **
14-
1512
** Please note: this example will only work on processors like the Artemis which have plenty of RAM available **
1613
1714
This code is intended to be run on the MicroMod Data Logging Carrier Board using the Artemis Processor

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,10 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
12431243
}
12441244
else if (currentSentence == NMEA)
12451245
{
1246+
//If _logNMEA is true, attempt to store incoming in the file buffer
1247+
if (_logNMEA)
1248+
storeFileBytes(&incoming, 1);
1249+
12461250
processNMEA(incoming); //Process each NMEA character
12471251
}
12481252
else if (currentSentence == RTCM)
@@ -1259,10 +1263,6 @@ void SFE_UBLOX_GNSS::processNMEA(char incoming)
12591263
//If user has assigned an output port then pipe the characters there
12601264
if (_nmeaOutputPort != NULL)
12611265
_nmeaOutputPort->write(incoming); //Echo this byte to the serial port
1262-
1263-
//If _logNMEA is true, attempt to store incoming in the file buffer
1264-
if (_logNMEA)
1265-
storeFileBytes((uint8_t *)&incoming, 1);
12661266
}
12671267

12681268
//We need to be able to identify an RTCM packet and then the length

0 commit comments

Comments
 (0)