reset.cpp: verbose syncwakeup

This commit is contained in:
cyberman54 2023-03-12 18:09:20 +01:00
parent c442020508
commit d2af3479b5

View File

@ -23,8 +23,10 @@ void reset_rtc_vars(void) {
void adjust_wakeup(uint32_t *wakeuptime) { void adjust_wakeup(uint32_t *wakeuptime) {
// only adjust wakeup if we have a valid time // only adjust wakeup if we have a valid time
if ((timeSource == _unsynced) || if ((timeSource == _unsynced) ||
(sntp_get_sync_status() == SNTP_SYNC_STATUS_IN_PROGRESS)) (sntp_get_sync_status() == SNTP_SYNC_STATUS_IN_PROGRESS)) {
ESP_LOGI(TAG, "Syncwakeup: No valid time for sync");
return; return;
}
time_t now; time_t now;
time(&now); time(&now);
@ -38,7 +40,8 @@ void adjust_wakeup(uint32_t *wakeuptime) {
} else if (shift_sec >= (3600 - SYNCWAKEUP)) { } else if (shift_sec >= (3600 - SYNCWAKEUP)) {
*wakeuptime = 3600 - shift_sec; // shorten wake up to next top-of-hour *wakeuptime = 3600 - shift_sec; // shorten wake up to next top-of-hour
ESP_LOGI(TAG, "Syncwakeup: Wakeup %hu sec preponed", shift_sec); ESP_LOGI(TAG, "Syncwakeup: Wakeup %hu sec preponed", shift_sec);
} } else
ESP_LOGI(TAG, "Syncwakeup: Wakeup keeping unshifted");
} }
#endif #endif