mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 09:26:52 +00:00
Don't reject network time updates unintentionally (#4489)
This commit is contained in:
parent
e37acae405
commit
1bbc273ba6
@ -140,7 +140,8 @@ void PositionModule::trySetRtc(meshtastic_Position p, bool isLocal, bool forceUp
|
|||||||
|
|
||||||
bool PositionModule::hasQualityTimesource()
|
bool PositionModule::hasQualityTimesource()
|
||||||
{
|
{
|
||||||
bool setFromPhoneOrNtpToday = (millis() - lastSetFromPhoneNtpOrGps) <= (SEC_PER_DAY * 1000UL);
|
bool setFromPhoneOrNtpToday =
|
||||||
|
lastSetFromPhoneNtpOrGps == 0 ? false : (millis() - lastSetFromPhoneNtpOrGps) <= (SEC_PER_DAY * 1000UL);
|
||||||
bool hasGpsOrRtc = (gps && gps->isConnected()) || (rtc_found.address != ScanI2C::ADDRESS_NONE.address);
|
bool hasGpsOrRtc = (gps && gps->isConnected()) || (rtc_found.address != ScanI2C::ADDRESS_NONE.address);
|
||||||
return hasGpsOrRtc || setFromPhoneOrNtpToday;
|
return hasGpsOrRtc || setFromPhoneOrNtpToday;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user