Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reject network time updates unintentionally #4488

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/modules/PositionModule.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !MESHTASTIC_EXCLUDE_GPS

Check failure on line 1 in src/modules/PositionModule.cpp

View workflow job for this annotation

GitHub Actions / Trunk Check

clang-format

Incorrect formatting, autoformat by running 'trunk fmt'
#include "PositionModule.h"
#include "Default.h"
#include "GPS.h"
Expand Down Expand Up @@ -140,7 +140,7 @@

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);
return hasGpsOrRtc || setFromPhoneOrNtpToday;
}
Expand Down Expand Up @@ -469,4 +469,4 @@
}
}

#endif
#endif
Loading