trigger timesync only if a timesource is present

This commit is contained in:
Klaus K Wilting 2020-11-02 21:32:45 +01:00
parent 70a37322b5
commit 8b496d9df4

View File

@ -490,12 +490,9 @@ void setup() {
sendTimer.attach(cfg.sendcycle * 2, setSendIRQ);
cyclicTimer.attach(HOMECYCLE, setCyclicIRQ);
#if (TIME_SYNC_INTERVAL)
#if (!(TIME_SYNC_LORAWAN) && !(TIME_SYNC_LORASERVER) && !defined HAS_GPS && \
!defined HAS_RTC)
#warning you did not specify a time source, time will not be synched
#endif
// only if we have a timesource we do timesync
#if ((TIME_SYNC_LORAWAN) || (TIME_SYNC_LORASERVER) || (HAS_GPS) || \
defined HAS_RTC)
#if (defined HAS_IF482 || defined HAS_DCF77)
ESP_LOGI(TAG, "Starting Clock Controller...");
@ -510,7 +507,9 @@ void setup() {
_ASSERT(timepulse_init()); // setup pps timepulse
timepulse_start(); // starts pps and cyclic time sync
#endif // TIME_SYNC_INTERVAL
strcat_P(features, "TIME");
#endif // timesync
// show compiled features
ESP_LOGI(TAG, "Features:%s", features);