From 7ceb52103e956a7fc812ce377eeeee3697f85dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 19 Nov 2022 09:58:29 +0100 Subject: [PATCH] Cleaning up GPS Code a bit --- platformio.ini | 2 +- src/GPSStatus.h | 16 ---------------- src/gps/NMEAGPS.cpp | 4 ++-- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/platformio.ini b/platformio.ini index 2d7c8209c..94e3e9f5b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -42,7 +42,7 @@ build_flags = -Wno-missing-field-initializers -Wno-format -Isrc -Isrc/mesh -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map -DUSE_THREAD_NAMES - -DTINYGPS_OPTION_NO_CUSTOM_FIELDS +; -DTINYGPS_OPTION_NO_CUSTOM_FIELDS // this should work now... -DPB_ENABLE_MALLOC=1 -DRADIOLIB_EXCLUDE_CC1101 -DRADIOLIB_EXCLUDE_NRF24 diff --git a/src/GPSStatus.h b/src/GPSStatus.h index cde351818..35a0b11f2 100644 --- a/src/GPSStatus.h +++ b/src/GPSStatus.h @@ -25,22 +25,6 @@ class GPSStatus : public Status public: GPSStatus() { statusType = STATUS_TYPE_GPS; } - // // proposed for deprecation - // GPSStatus(bool hasLock, bool isConnected, int32_t latitude, int32_t longitude, int32_t altitude, uint32_t dop, - // uint32_t heading, uint32_t numSatellites) - // : Status() - // { - // this->hasLock = hasLock; - // this->isConnected = isConnected; - - // this->p.latitude_i = latitude; - // this->p.longitude_i = longitude; - // this->p.altitude = altitude; - // this->p.PDOP = dop; - // this->p.ground_track = heading; - // this->p.sats_in_view = numSatellites; - // } - // preferred method GPSStatus(bool hasLock, bool isConnected, const Position &pos) : Status() { diff --git a/src/gps/NMEAGPS.cpp b/src/gps/NMEAGPS.cpp index 1b103f534..0ff302bab 100644 --- a/src/gps/NMEAGPS.cpp +++ b/src/gps/NMEAGPS.cpp @@ -109,7 +109,7 @@ bool NMEAGPS::lookForLocation() #ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS fixType = atoi(gsafixtype.value()); // will set to zero if no data - DEBUG_MSG("FIX QUAL=%d, TYPE=%d\n", fixQual, fixType); + // DEBUG_MSG("FIX QUAL=%d, TYPE=%d\n", fixQual, fixType); #endif // check if GPS has an acceptable lock @@ -168,7 +168,7 @@ bool NMEAGPS::lookForLocation() #ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS p.HDOP = reader.hdop.value(); p.PDOP = TinyGPSPlus::parseDecimal(gsapdop.value()); - DEBUG_MSG("PDOP=%d, HDOP=%d\n", dop, reader.hdop.value()); + // DEBUG_MSG("PDOP=%d, HDOP=%d\n", p.PDOP, p.HDOP); #else // FIXME! naive PDOP emulation (assumes VDOP==HDOP) // correct formula is PDOP = SQRT(HDOP^2 + VDOP^2)