From 9e55e6befbfb9438204d4e35aeeb7797eceb98f8 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Thu, 5 Sep 2024 19:16:06 +0800 Subject: [PATCH] Minor GPS fixes (#4630) 1. Remove unused line in GPS::probe 2. update new PositionModule::hasQualityTimeSource to handle MESHTASTIC_EXCLUDE_GPS --- src/gps/GPS.cpp | 5 +---- src/modules/PositionModule.cpp | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 12ef34c52..da9b5b1a8 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1252,9 +1252,6 @@ GnssModel_t GPS::probe(int serialSpeed) LOG_INFO("Aioha AG3335 detected, using AG3335 Module\n"); return GNSS_MODEL_AG3335; } - // Get version information for Airoha AG3335 - clearBuffer(); - _serial_gps->write("$PMTK605*31\r\n"); // Get version information clearBuffer(); @@ -1843,4 +1840,4 @@ void GPS::toggleGpsMode() enable(); } } -#endif // Exclude GPS \ No newline at end of file +#endif // Exclude GPS diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 7c08835bc..cb6a58b2e 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -146,7 +146,11 @@ bool PositionModule::hasQualityTimesource() { bool setFromPhoneOrNtpToday = lastSetFromPhoneNtpOrGps == 0 ? false : (millis() - lastSetFromPhoneNtpOrGps) <= (SEC_PER_DAY * 1000UL); +#if MESHTASTIC_EXCLUDE_GPS + bool hasGpsOrRtc = (rtc_found.address != ScanI2C::ADDRESS_NONE.address); +#else bool hasGpsOrRtc = (gps && gps->isConnected()) || (rtc_found.address != ScanI2C::ADDRESS_NONE.address); +#endif return hasGpsOrRtc || setFromPhoneOrNtpToday; }