fix HAS_RTC ifdef to fix compiling for boards without RTC
This commit is contained in:
parent
70a51563b2
commit
ebefd5d234
@ -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");
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user