Compare commits

...

3 Commits

Author SHA1 Message Date
Jonathan Bennett
4fd7960371 Drop debug warning 2025-12-13 12:22:22 -06:00
Jonathan Bennett
5f0e86a27e Merge branch 'develop' into native-time 2025-12-13 12:10:18 -06:00
Jonathan Bennett
9ce1a7ff79 Detect if NTP is active on native 2025-12-13 12:08:24 -06:00

View File

@@ -428,10 +428,17 @@ void setup()
#endif #endif
#if ARCH_PORTDUINO #if ARCH_PORTDUINO
RTCQuality ourQuality = RTCQualityDevice;
std::string timeCommandResult = exec("timedatectl status | grep synchronized | grep yes -c");
if (timeCommandResult[0] == '1') {
ourQuality = RTCQualityNTP;
}
struct timeval tv; struct timeval tv;
tv.tv_sec = time(NULL); tv.tv_sec = time(NULL);
tv.tv_usec = 0; tv.tv_usec = 0;
perhapsSetRTC(RTCQualityDevice, &tv); perhapsSetRTC(ourQuality, &tv);
#endif #endif
powerMonInit(); powerMonInit();