MeshCore/examples/companion_radio
Wessel Nieboer 5f36fde054
Allow setting RTC clock backwards and fix elapsed-time underflow
Remove the "clock cannot go backwards" restriction from all set-time
paths (CLI `time`, `clock sync`, companion radio CMD_SET_DEVICE_TIME,
and simple_secure_chat). The ESP32-S3 RTC drifts 5-10% during deep
sleep, making backwards correction necessary after even a few days.

Add safeElapsedSecs() helper in ArduinoHelpers.h that clamps elapsed
time to 0 when a stored timestamp appears to be in the future after a
clock correction. Applied to:
- Neighbor "heard X ago" displays in simple_repeater
- UI time displays in companion_radio
- TimeSeriesData calculations in simple_sensor

Switch BaseChatMesh connection expiry from RTC timestamps to monotonic
millis(), making it immune to RTC adjustments from GPS, NTP, or manual
sync. Rename last_activity to last_activity_ms to reflect the change.
2026-04-04 13:19:21 +02:00
..
ui-new Allow setting RTC clock backwards and fix elapsed-time underflow 2026-04-04 13:19:21 +02:00
ui-orig Add battery min/max voltage parameter support 2026-01-28 22:24:49 -07:00
AbstractUITask.h ♻️ refactor: unify UI notification methods into single notify() function 2025-09-17 08:56:18 +08:00
DataStore.cpp Rename sx126x_rx_boosted_gain to rx_boosted_gain 2026-03-05 18:14:47 +00:00
DataStore.h add DataStore::deleteBlobByKey() 2026-02-01 00:02:29 +11:00
main.cpp fix: apply persisted GPS enabled setting on boot for companion radio 2026-03-24 09:10:09 -05:00
MyMesh.cpp Allow setting RTC clock backwards and fix elapsed-time underflow 2026-04-04 13:19:21 +02:00
MyMesh.h * Companion: applyGPSPrefs() now just in one place (moved out of UITask) 2026-03-25 16:26:51 +11:00
NodePrefs.h Rename sx126x_rx_boosted_gain to rx_boosted_gain 2026-03-05 18:14:47 +00:00