Skip to content

Commit 53631dc

Browse files
committed
Update last attempt only if RTC is online
Re-implementing main #422 - 09a4b45
1 parent 264c194 commit 53631dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Firmware/RTK_Everywhere/MQTT_Client.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,10 @@ void mqttClientReceiveMessage(int messageSize)
463463
settings.pointPerfectNextKeyDuration =
464464
(1000LL * 60 * 60 * 24 * 28) - 1; // Assume next key duration is 28 days
465465

466-
settings.lastKeyAttempt = rtc.getEpoch(); // Mark it
467-
468-
recordSystemSettings(); // Record these settings to unit
466+
if (online.rtc)
467+
settings.lastKeyAttempt = rtc.getEpoch(); // Mark it - but only if RTC is online
468+
469+
recordSystemSettings(); // Record these settings to unit
469470

470471
if (settings.debugCorrections == true)
471472
pointperfectPrintKeyInformation();

0 commit comments

Comments
 (0)