Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gps parse improvements #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jpuderer
Copy link

@jpuderer jpuderer commented Mar 9, 2024

This pull request fixes issues #128 #153 and #154

It has been thoroughly tested and creates a smaller footprint than the original parser, so it should
not cause issues with the Arduino Uno.

Compiling GPS_SoftwareSerial_Parsing for Arduino Uno before refactor:

Sketch uses 15042 bytes (46%) of program storage space. Maximum is 32256 bytes.
Global variables use 1470 bytes (71%) of dynamic memory, leaving 578 bytes for local variables. Maximum is 2048 bytes.

Compiling GPS_SoftwareSerial_Parsing for Arduino Uno after refactor:

Sketch uses 14848 bytes (46%) of program storage space. Maximum is 32256 bytes.
Global variables use 1470 bytes (71%) of dynamic memory, leaving 578 bytes for local variables. Maximum is 2048 bytes.

Improves the current implementation of the parse() method to scan
the entire sentence and count the fields before attempting to read
the fields.  This prevents accidental invalid pointer accesses when
parsing invalid sentences with valid checksums.

The new parse implementation also has a smaller compiled size.

Includes a sketch in the "extras" directory (ignored by the Arduino
IDE according to the library spec) that was used for testing the
parsing of all sentences known to the parser.
Implementation of isEmpty() was incorrect since it performed
a null check after dereferencing the pointer
@jpuderer
Copy link
Author

Can someone have a look at this please? It was a fair amount of work, and is a substantial improvement to the parsing.

It addresses #153 and #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant