From fdda5b6e1ebd76545d90007e74fc9b26f97f48b4 Mon Sep 17 00:00:00 2001 From: Rick Sellens Date: Fri, 7 Feb 2020 20:20:30 -0500 Subject: [PATCH] clang --- src/Adafruit_GPS.cpp | 10 +++++----- src/NMEA_build.cpp | 4 ++-- src/NMEA_parse.cpp | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Adafruit_GPS.cpp b/src/Adafruit_GPS.cpp index c6acd61..2d8f25a 100644 --- a/src/Adafruit_GPS.cpp +++ b/src/Adafruit_GPS.cpp @@ -349,11 +349,11 @@ size_t Adafruit_GPS::write(uint8_t c) { /**************************************************************************/ /*! - @brief Read one character from the GPS device. - + @brief Read one character from the GPS device. + Call very frequently and multiple times per opportunity or the buffer may overflow if there are frequent NMEA sentences. An 82 character NMEA - sentence 10 times per second will require 820 calls per second, and + sentence 10 times per second will require 820 calls per second, and once a loop() may not be enough. Check for newNMEAreceived() after at least every 10 calls, or you may miss some short sentences. @return The character that we received, or 0 if nothing was available @@ -385,8 +385,8 @@ char Adafruit_GPS::read(void) { _buff_idx++; } else { // refill the buffer! - if (gpsI2C->requestFrom((uint8_t)0x10, (uint8_t)GPS_MAX_I2C_TRANSFER, (uint8_t) true) == - GPS_MAX_I2C_TRANSFER) { + if (gpsI2C->requestFrom((uint8_t)0x10, (uint8_t)GPS_MAX_I2C_TRANSFER, + (uint8_t) true) == GPS_MAX_I2C_TRANSFER) { // got data! _buff_max = 0; char curr_char = 0; diff --git a/src/NMEA_build.cpp b/src/NMEA_build.cpp index 201f30c..a45dad4 100644 --- a/src/NMEA_build.cpp +++ b/src/NMEA_build.cpp @@ -570,9 +570,9 @@ char *Adafruit_GPS::build(char *nmea, const char *thisSource, addChecksum(nmea); // Successful completion if (!noCRLF) { // Add Carriage Return and Line Feed to comply with NMEA-183 - sprintf(nmea, "%s\r\n", nmea); + sprintf(nmea, "%s\r\n", nmea); } - return nmea; // return pointer to finished product + return nmea; // return pointer to finished product } #endif // NMEA_EXTENSIONS diff --git a/src/NMEA_parse.cpp b/src/NMEA_parse.cpp index a7bae50..63be746 100644 --- a/src/NMEA_parse.cpp +++ b/src/NMEA_parse.cpp @@ -782,9 +782,10 @@ bool Adafruit_GPS::parseTime(char *p) { seconds = (time % 100); char *dec = strchr(p, '.'); char *comstar = min(strchr(p, ','), strchr(p, '*')); - if(dec != NULL && comstar != NULL && dec < comstar) + if (dec != NULL && comstar != NULL && dec < comstar) milliseconds = atof(p) * 1000; - else milliseconds = 0; + else + milliseconds = 0; lastTime = sentTime; return true; }