Просмотр исходного кода

Merge pull request #4185 from argetlam-coder/fix-timezone-without-ntp

Apply configured time zone even when NTP is disabled
SybexXx 1 месяц назад
Родитель
Сommit
80eaeae57f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      code/components/jomjol_time_sntp/time_sntp.cpp

+ 2 - 2
code/components/jomjol_time_sntp/time_sntp.cpp

@@ -278,10 +278,10 @@ bool setupTime() {
         esp_sntp_config_t config = ESP_NETIF_SNTP_DEFAULT_CONFIG(timeServer.c_str());
         config.sync_cb = time_sync_notification_cb;
         esp_netif_sntp_init(&config);
-
-        setTimeZone(timeZone);
     }
 
+    setTimeZone(timeZone);
+
     /* The RTC keeps the time after a restart (Except on Power On or Pin Reset) 
      * There should only be a minor correction through NTP */