From fd9f930e7111d79c181b0660059185d31e932ddc Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Wed, 30 Sep 2020 11:48:06 +0300 Subject: [PATCH] ntp: use the actual legacy default values --- code/espurna/config/general.h | 22 ---------------------- code/espurna/ntp.cpp | 6 +++--- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 158b59fc..2f0d9efa 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -1596,28 +1596,6 @@ #define NTP_WAIT_FOR_SYNC 1 // Do not report any datetime until NTP sync'ed #endif -// WARNING: legacy NTP settings. can be ignored with Core 2.6.2+ - -#ifndef NTP_TIMEOUT -#define NTP_TIMEOUT 1000 // Set NTP request timeout to 2 seconds (issue #452) -#endif - -#ifndef NTP_TIME_OFFSET -#define NTP_TIME_OFFSET 60 // Default timezone offset (GMT+1) -#endif - -#ifndef NTP_DAY_LIGHT -#define NTP_DAY_LIGHT 1 // Enable daylight time saving by default -#endif - -#ifndef NTP_SYNC_INTERVAL -#define NTP_SYNC_INTERVAL 60 // NTP initial check every minute -#endif - -#ifndef NTP_DST_REGION -#define NTP_DST_REGION 0 // 0 for Europe, 1 for USA (defined in NtpClientLib) -#endif - // ----------------------------------------------------------------------------- // ALEXA // ----------------------------------------------------------------------------- diff --git a/code/espurna/ntp.cpp b/code/espurna/ntp.cpp index 2437addc..f58ddf72 100644 --- a/code/espurna/ntp.cpp +++ b/code/espurna/ntp.cpp @@ -351,8 +351,8 @@ void _ntpConvertLegacyOffsets() { bool found { false }; bool europe { true }; - bool dst { false }; - int offset { 0 }; + bool dst { true }; + int offset { 60 }; settings::kv_store.foreach([&](settings::kvs_type::KeyValueResult&& kv) { const auto key = kv.key.read(); @@ -374,7 +374,7 @@ void _ntpConvertLegacyOffsets() { // XXX: only expect offsets in hours String custom { europe ? F("CET") : F("CST") }; - custom.reserve(16); + custom.reserve(32); if (offset > 0) { custom += '-';