diff --git a/src/main.cpp b/src/main.cpp index b9176b0c..e84c376a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -471,15 +471,15 @@ void setup() { button_init(HAS_BUTTON); #endif // HAS_BUTTON - // cyclic function interrupts - cyclicTimer.attach(HOMECYCLE, setCyclicIRQ); - // only if we have a timesource we do timesync #if ((HAS_LORA_TIME) || (HAS_GPS) || (HAS_RTC)) time_init(); strcat_P(features, " TIME"); #endif // timesync + // cyclic function interrupts + cyclicTimer.attach(HOMECYCLE, setCyclicIRQ); + // show compiled features ESP_LOGI(TAG, "Features:%s", features); diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index 3545d915..896f49ec 100644 --- a/src/timekeeper.cpp +++ b/src/timekeeper.cpp @@ -381,13 +381,16 @@ time_t mkgmtime(const struct tm *ptm) { } void time_init(void) { -#if (HAS_LORA_TIME) - timesync_init(); // create loraserver time sync task -#endif - ESP_LOGI(TAG, "Starting time pulse..."); - timepulse_init(); // starts pps and cyclic time sync + #if (defined HAS_IF482 || defined HAS_DCF77) ESP_LOGI(TAG, "Starting clock controller..."); clock_init(); #endif + +#if (HAS_LORA_TIME) + timesync_init(); // create loraserver time sync task +#endif + + ESP_LOGI(TAG, "Starting time pulse..."); + timepulse_init(); // starts pps and cyclic time sync } \ No newline at end of file