Add NTP update state. Refactoring.

This commit is contained in:
2024-04-04 01:45:11 +02:00
parent f4b49dd8c4
commit 5a51707452
4 changed files with 81 additions and 32 deletions

View File

@@ -71,7 +71,7 @@
// NTP macros
#define BUILD_YEAR (__DATE__ + 7) // Will expand to current year at compile time as string.
#define NTP_MININUM_RX_YEAR (atoi(BUILD_YEAR) - 1) // Will expand to current year minus one at compile time.
#define NTP_MININUM_YEAR (1900) // NTP minimum year is 1900
#define NTP_START_YEAR (1900) // NTP minimum year is 1900
#define NTP_UPDATE_PERIOD_S (12 * 3600) // 12h period between updates
#define NTP_RETRY_DELAY_US (10 * 1000 * 1000) // 10s retry delay time between failed NTP requests
#define NTP_MAX_OFFLINE_TIME_S (7 * 24 * 3600) // Watchdog value, maxmimum offline time before a restart is triggered