fix HAS_RTC ifdef to fix compiling for boards without RTC

This commit is contained in:
Oliver Brandmueller 2019-01-28 09:44:30 +01:00
parent 70a51563b2
commit ebefd5d234
2 changed files with 3 additions and 3 deletions

View File

@ -132,10 +132,10 @@ void do_timesync() {
#ifdef HAS_RTC
if (!set_rtctime(RtcDateTime(now())))
ESP_LOGE(TAG, "RTC set time failure");
#endif
time_t tt = myTZ.toLocal(now());
ESP_LOGI(TAG, "GPS has set system time to %02d/%02d/%d %02d:%02d:%02d",
month(tt), day(tt), year(tt), hour(tt), minute(tt), second(tt));
#endif
return;
} else {
ESP_LOGI(TAG, "No valid GPS time");

View File

@ -458,9 +458,9 @@ void user_request_network_time_callback(void *pVoidUserUTCTime,
#ifdef HAS_RTC
if (!set_rtctime(*pUserUTCTime))
ESP_LOGE(TAG, "RTC set time failure");
#endif
time_t t = myTZ.toLocal(now());
ESP_LOGI(TAG,
"LORA Network has set system time to %02d/%02d/%d %02d:%02d:%02d",
month(t), day(t), year(t), hour(t), minute(t), second(t));
}
#endif
}