64 Commits
Author SHA1 Message Date
Rick Sellens fdda5b6e1e clang 2020-02-07 20:20:30 -05:00
Rick Sellens 59c1a4acbd casts to make unambiguous on UNO 2020-02-07 20:04:33 -05:00
Rick Sellens 8c550d278e fix to parsing bug on RMB sentence 2020-02-07 14:54:26 -05:00
Rick Sellens a047465a73 More rigor in parseTime()
previous version ran ok with M0, but generated exceptions in ESP32 when decimals not found.
2020-02-07 14:26:39 -05:00
Rick Sellens 07fd81fd91 explicit cast eliminates ambiguity
ESP32 wire lib includes requestFrom(int,int,int) and requestFrom(uint16_t,uint8_t,bool) and throws a warning trying to resolve.
2020-01-31 07:30:30 -05:00
Rick Sellens 50abddc691 comments to solve: https://github.com/adafruit/Adafruit_GPS/issues/76
Corrections to original comments that were off by a factor of 10.
2020-01-30 20:14:52 -05:00
Rick Sellens d0f7f47dc9 Warning about scaling 2020-01-30 17:09:35 -05:00
Rick Sellens d14e220c1b Add noCRLF option to build()
new optional argument will leave the carriage return and linefeed off the end of an NMEA sentence.
2020-01-30 14:29:17 -05:00
Rick Sellens deb312b293 Clear thisSentence and thisSource at start of each check
that way previous sentence identifiers won't bleed through on failure.
2020-01-29 19:52:13 -05:00
Rick Sellens 84eaad66e4 Fail Check if sentence not recognized
Previous check would pass for unknown but properly formatted sentence.
2020-01-29 19:44:05 -05:00
Rick Sellens ebb09d0480 clang 2020-01-29 13:23:02 -05:00
Rick Sellens 1afe1df764 clang 2020-01-29 13:10:43 -05:00
Rick Sellens 8ae6a7b75a clang 2020-01-29 12:57:20 -05:00
Rick Sellens 7d889e3a9d Reorder and document
Align the order in the .h with the order in the various .cpp
Note that ! is also a valid starting character for an NMEA sentence.
2020-01-29 12:03:25 -05:00
Rick Sellens 1d58e4e66e run data_init() under common_init() 2020-01-29 10:35:00 -05:00
Rick Sellens 0fca64d082 Comment out old Lat Lon parsing
new parse() uses generalized parseCoord()
2020-01-29 10:27:05 -05:00
Rick Sellens 3876f29fc1 New parse() with more sentences
move other parsing functions in NMEA_parse.cpp
fix parseTime to be insensitive to number of decimal places and return bool.
add isEmpty() checks where needed.
reorder some declarations.
2020-01-29 10:18:41 -05:00
Rick Sellens 4b6e181770 New version of build() with more sentences
move addChecksum() to NMEA_build.cpp
2020-01-29 10:03:59 -05:00
Rick Sellens 0b0996bbb0 Add NMEA_EXTRAS for command line compile control 2020-01-29 09:59:47 -05:00
Rick Sellens 2a5b5bdd1c Update source and sentence lists 2020-01-29 09:57:49 -05:00
Rick Sellens 6f41d311cd Add no comms constructor, destructor, data values 2020-01-29 09:56:21 -05:00
Rick Sellens bc038a14cf Example updates 2020-01-29 09:33:26 -05:00
Rick Sellens 6ea92a021d Create keywords.txt 2020-01-29 09:31:41 -05:00
Rick Sellens 7025f17c82 clang 2020-01-21 14:20:40 -05:00
Rick Sellens 35069cb40c trigger a new check run 2020-01-21 13:49:48 -05:00
Rick Sellens 15788bd2f0 let the float type be set from the compile command line 2020-01-21 12:34:35 -05:00
Rick Sellens af963a4846 clang 2020-01-19 20:25:14 -05:00
Rick Sellens 716315af97 single is not float
that's what happens when you rush
2020-01-19 20:16:24 -05:00
Rick Sellens edc7146730 Update NMEA_data.h 2020-01-19 19:48:00 -05:00
Rick Sellens 7d806715fc this one too 2020-01-19 09:52:28 -05:00
Rick Sellens 3a823f80e0 this comment has a trailing space 2020-01-19 09:37:51 -05:00
Rick Sellens 8c3bdfd0ca clang 2020-01-19 09:15:18 -05:00
Rick Sellens c006654469 clang hates trailing white space 2020-01-19 08:56:06 -05:00
Rick Sellens 0051f37600 change from float to nmea_float_t
Not sure whether to make it float or double by default

/*************************************************************************
  doubles and floats are identical on AVR processors like the UNO where space
  is tight. doubles avoid the roundoff errors that led to the fixed point mods
  in https://github.com/adafruit/Adafruit-GPS-Library/pull/13, provided the
  processor supports actual doubles like the SAMD series with more storage. The
  total penalty for going all double is under a few hundred bytes / instance or
  0 bytes / instance on an UNO. This typedef allows a switch to lower precision
  to save some storage if needed. A float carries 23 bits of fractional
  resolution, giving a resolution of at least 9 significant digits, thus 6
  significant digits in the decimal place of an angular value like latitude, and
  thus a resolution on earth of at least 110 mm. That's closer than GPS will
  hit, and closer than needed for navigation, so floats can be used to save a
  little storage.
 **************************************************************************/
typedef double
    nmea_float_t; ///< the type of variables to use for floating point
2020-01-19 08:14:02 -05:00
Rick Sellens 8739f08ca6 move resetSentTime out of extensions
potentially useful elsewhere, and small
2020-01-19 08:06:26 -05:00
Rick Sellens 4bfbd03b90 move PMTK defines to their own .h 2020-01-19 07:54:34 -05:00
Rick Sellens aa56da31e7 Add NMEA_data.h
typedefs to support tracking more NMEA data besides position.
2020-01-19 07:48:41 -05:00
Rick Sellens d1c93e04a7 Move parse and build to their own source files 2020-01-19 07:43:48 -05:00
Rick Sellens 30280c5de2 Moved source files to source, no other changes 2020-01-19 07:31:56 -05:00
Rick Sellens 2c2272e3fd Delete .DS_Store 2020-01-18 16:42:18 -05:00
Rick Sellens 88ea487b3e Create .gitignore 2020-01-18 16:41:28 -05:00
Rick Sellens 2a34d48836 another space 2020-01-18 11:09:42 -05:00
Rick Sellens b982d8948e more clang 2020-01-18 10:43:35 -05:00
Rick Sellens c8d4e037e7 clanged files 2020-01-18 10:23:14 -05:00
Rick Sellens a41cbce062 Add build() example to GPS_Hardware_Serial_Timing.ino 2020-01-18 09:18:13 -05:00
Rick Sellens f02d93b749 Redo Pull Request 108
Created new fork in hopes of making things mergeable
2020-01-18 09:07:15 -05:00
Rick Sellens 3e5946617f more Doxygen 2020-01-08 13:28:38 -05:00
Rick Sellens 11c02f691b Doxygen comments added 2020-01-08 13:08:10 -05:00
Rick Sellens eec5282c19 Reinsert strStartsWith() needed elsewhere 2020-01-08 12:05:07 -05:00
Rick Sellens 4a14547ede Improve NMEA sentence checking
Add check(), addChecksum(), tokenOnList(), and supporting variables. Modify parse() to use check() and test only on sentence name, e.g. GGA rather than $GPGGA. Uses strcmp() to eliminate the custom strStartsWith().
2020-01-08 11:04:21 -05:00
Rick Sellens ce333bf713 Move declarations to class private
Variables for buffering were global to the cpp file. Two instances would overwrite each other's buffers.
2019-12-29 12:10:39 -05:00
Rick Sellens 1f8c5a58d7 Change GPS time alignment
Detect time first character of NMEA sentence received and treat that as corresponding to GPS timestamp in the sentence. Still some latency, but less than using the end of the receipt.
2019-09-29 12:26:01 -04:00
sellensr 5934857f24 Create .uno.test.skip
Uses Serial1, so it won't work with UNO, but does compile OK with ESP8266 (haven't tested)
2019-04-22 18:32:22 -04:00
sellensr e121bb53c8 Track when sentence received
Improve the time information by tracking from when a sentence is received, rather than when it is parsed. Track last valid Date, Time, and Fix separately.
2019-04-20 13:51:00 -04:00
sellensr 76a0384f71 parse() improvements
Split out separate functions to parse fragments of sentences for time, lat, lon, fix. No functional changes. Reduces repetition and makes parsing process more readable. Will make adding new sentences less cumbersome. The difference tracking gets a little wonky stretching across function boundaries.

Added timeSinceFix() to return seconds since a valid fix was received. Modified $GPGGA parsing to also set fix = true/false based on quality.

Added more output sentences to Adafruit_GPS.h to facilittate testing with different sentences.
2019-04-17 22:37:47 -04:00
Rick Sellens 5407c85b41 Merge pull request #3 from adafruit/master
Merge pull request #88 from sellensr/master
2019-04-17 21:54:23 -04:00
sellensr 1f369b6a8c Merge branch 'master' of https://github.com/sellensr/Adafruit_GPS 2019-04-16 19:49:10 -04:00
sellensr 44af8c9086 Index checksum explicitly on $ and *
parse() Improves slightly on https://github.com/adafruit/Adafruit_GPS/pull/86 by indexing on the position of the $ and the * in the string instead of the beginning and the end of the string.  Does not require sentence string have a particular termination, e.g. CRLF.
2019-04-16 19:49:01 -04:00
Rick Sellens 1b47fb7334 Merge pull request #2 from adafruit/master
update
2019-04-16 19:23:48 -04:00
Rick Sellens ff2c714d4d Merge pull request #1 from adafruit/master
Update my fork from the adafruit repo
2019-04-16 13:00:42 -04:00
sellensr 8bad5eacfb tidy lines and checksum
Parse start of checksum as character after first $.
Don't include '\n' or '\r' in GPS lines read. Previous code was putting '\r' at the end of each line and '\n' at the start before the $, thus having to start the checksum calculation at the third character. This may break the spacing on some code that prints out the NMEA lines.
2019-04-15 13:50:37 -04:00
sellensr 0f867b508a parse checksum to *
Parse the NMEA checksum based on the location of the asterisk, rather than the end of the string. Avoids problems if line ends with other than CRLF.
2019-04-15 11:51:40 -04:00
sellensr 8e17fcc9a9 Add $GPGLL sentence to parsing
$GPGLL has fewer arguments in a different order. The $GPRMC code was directly copied and the order rearranged.
2019-04-14 20:25:59 -04:00
sellensr 77176c2afd #define for 115200 baud 2019-04-14 19:40:39 -04:00