Validate RTC epoch before setting time

- Reject out-of-range DS3231 epochs and log accept/reject under SERIAL_DEBUG_MODE
- Document RTC validation so LoRa TimeSync can recover
This commit is contained in:
2026-02-04 00:31:10 +01:00
parent e8fb8680cb
commit e0d35d49bc
2 changed files with 13 additions and 0 deletions

View File

@@ -306,6 +306,7 @@ inline constexpr uint16_t EXPECTED_SENDER_IDS[NUM_SENDERS] = { 0xF19C };
- Receiver keeps sending time sync every 60 seconds.
- If a senders timestamps drift from receiver time by more than `TIME_SYNC_DRIFT_THRESHOLD_SEC`, the receiver enters a burst mode (every `TIME_SYNC_BURST_INTERVAL_MS` for `TIME_SYNC_BURST_DURATION_MS`).
- Sender raises a local `TimeSync` error if it has not received a time beacon for `TIME_SYNC_ERROR_TIMEOUT_MS` (default 2 days). This is shown on the sender OLED only and is not sent over LoRa.
- RTC loads are validated (reject out-of-range epochs) so LoRa TimeSync can recover if the RTC is wrong.
## Build Environments
- `lilygo-t3-v1-6-1`: production build (debug on)