Skip to content

Commit

Permalink
Minor GPS fixes (#4630)
Browse files Browse the repository at this point in the history
1. Remove unused line in GPS::probe
2. update new PositionModule::hasQualityTimeSource to handle
 MESHTASTIC_EXCLUDE_GPS
  • Loading branch information
fifieldt authored Sep 5, 2024
1 parent bb9ddcf commit 9e55e6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -1843,4 +1840,4 @@ void GPS::toggleGpsMode()
enable();
}
}
#endif // Exclude GPS
#endif // Exclude GPS
4 changes: 4 additions & 0 deletions src/modules/PositionModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9e55e6b

Please sign in to comment.