From fc20f658e61186ff4dc790342153200a522bb779 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 16 Sep 2020 09:22:03 -0700 Subject: [PATCH] Fix #362 by @a-f-G-U-C - I was mispelling NMEA ;-) --- docs/software/nrf52-TODO.md | 2 +- src/gps/{NEMAGPS.cpp => NMEAGPS.cpp} | 6 +++--- src/gps/{NEMAGPS.h => NMEAGPS.h} | 8 ++++---- src/gps/UBloxGPS.cpp | 2 +- src/main.cpp | 14 +++++++------- 5 files changed, 16 insertions(+), 16 deletions(-) rename src/gps/{NEMAGPS.cpp => NMEAGPS.cpp} (96%) rename src/gps/{NEMAGPS.h => NMEAGPS.h} (77%) diff --git a/docs/software/nrf52-TODO.md b/docs/software/nrf52-TODO.md index 0b0cfb6d5..46d320346 100644 --- a/docs/software/nrf52-TODO.md +++ b/docs/software/nrf52-TODO.md @@ -196,7 +196,7 @@ Nice ideas worth considering someday... - DONE neg 7 error code from receive - DONE remove unused sx1262 lib from github - at boot we are starting our message IDs at 1, rather we should start them at a random number. also, seed random based on timer. this could be the cause of our first message not seen bug. -- add a NEMA based GPS driver to test GPS +- add a NMEA based GPS driver to test GPS - DONE use "variants" to get all gpio bindings - DONE plug in correct variants for the real board - turn on DFU assistance in the appload using the nordic DFU helper lib call diff --git a/src/gps/NEMAGPS.cpp b/src/gps/NMEAGPS.cpp similarity index 96% rename from src/gps/NEMAGPS.cpp rename to src/gps/NMEAGPS.cpp index b933836d0..6b797fd7d 100644 --- a/src/gps/NEMAGPS.cpp +++ b/src/gps/NMEAGPS.cpp @@ -1,4 +1,4 @@ -#include "NEMAGPS.h" +#include "NMEAGPS.h" #include "configuration.h" #include "timing.h" @@ -11,7 +11,7 @@ static int32_t toDegInt(RawDegrees d) return r; } -void NEMAGPS::loop() +void NMEAGPS::loop() { while (_serial_gps->available() > 0) { int c = _serial_gps->read(); @@ -69,7 +69,7 @@ void NEMAGPS::loop() } // expect gps pos lat=37.520825, lon=-122.309162, alt=158 - DEBUG_MSG("new NEMA GPS pos lat=%f, lon=%f, alt=%d, hdop=%f, heading=%f\n", latitude * 1e-7, longitude * 1e-7, + DEBUG_MSG("new NMEA GPS pos lat=%f, lon=%f, alt=%d, hdop=%f, heading=%f\n", latitude * 1e-7, longitude * 1e-7, altitude, dop * 1e-2, heading * 1e-5); } diff --git a/src/gps/NEMAGPS.h b/src/gps/NMEAGPS.h similarity index 77% rename from src/gps/NEMAGPS.h rename to src/gps/NMEAGPS.h index 2640bcef1..71b24a65a 100644 --- a/src/gps/NEMAGPS.h +++ b/src/gps/NMEAGPS.h @@ -1,19 +1,19 @@ #pragma once +#include "../concurrency/PeriodicTask.h" #include "GPS.h" #include "Observer.h" -#include "../concurrency/PeriodicTask.h" #include "TinyGPS++.h" /** - * A gps class thatreads from a NEMA GPS stream (and FIXME - eventually keeps the gps powered down except when reading) + * A gps class thatreads from a NMEA GPS stream (and FIXME - eventually keeps the gps powered down except when reading) * * When new data is available it will notify observers. */ -class NEMAGPS : public GPS +class NMEAGPS : public GPS { TinyGPSPlus reader; - + uint32_t lastUpdateMsec = 0; public: diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 624ab77b8..93e8a01cf 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -103,7 +103,7 @@ bool UBloxGPS::factoryReset() { bool ok = false; - // It is useful to force back into factory defaults (9600baud, NEMA to test the behavior of boards that don't have + // It is useful to force back into factory defaults (9600baud, NMEA to test the behavior of boards that don't have // GPS_TX connected) ublox.factoryReset(); delay(5000); diff --git a/src/main.cpp b/src/main.cpp index f7af6d232..0a474e087 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,7 @@ #include "MeshRadio.h" #include "MeshService.h" -#include "NEMAGPS.h" +#include "NMEAGPS.h" #include "NodeDB.h" #include "PowerFSM.h" #include "UBloxGPS.h" @@ -256,16 +256,16 @@ void setup() if (GPS::_serial_gps) { // Some boards might have only the TX line from the GPS connected, in that case, we can't configure it at all. Just - // assume NEMA at 9600 baud. - DEBUG_MSG("Hoping that NEMA might work\n"); + // assume NMEA at 9600 baud. + DEBUG_MSG("Hoping that NMEA might work\n"); - // dumb NEMA access only work for serial GPSes) - gps = new NEMAGPS(); + // dumb NMEA access only work for serial GPSes) + gps = new NMEAGPS(); gps->setup(); } } #else - gps = new NEMAGPS(); + gps = new NMEAGPS(); gps->setup(); #endif gpsStatus->observe(&gps->newStatus); @@ -407,7 +407,7 @@ void loop() // Update the screen last, after we've figured out what to show. screen.debug_info()->setChannelNameStatus(getChannelName()); - + // No GPS lock yet, let the OS put the main CPU in low power mode for 100ms (or until another interrupt comes in) // i.e. don't just keep spinning in loop as fast as we can. // DEBUG_MSG("msecs %d\n", msecstosleep);