Skip to content

Commit f066ed2

Browse files
authored
configTime(tzsec,dstsec,): fix UTC/local management (#6993)
* configTime(tzsec,dstsec,): fix UTC/local management This PR also remove dead code since probably newlib updates The NTP-TZ-DST example is also updated * restore sntp_set_timezone_in_seconds() fixes #6678 * +configTzTime()
1 parent e752e96 commit f066ed2

File tree

6 files changed

+83
-389
lines changed

6 files changed

+83
-389
lines changed

cores/esp8266/Arduino.h

+7
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ void configTime(int timezone, int daylightOffset_sec, const char* server1,
281281
void configTime(const char* tz, const char* server1,
282282
const char* server2 = nullptr, const char* server3 = nullptr);
283283

284+
// esp32 api compatibility
285+
inline void configTzTime(const char* tz, const char* server1,
286+
const char* server2 = nullptr, const char* server3 = nullptr)
287+
{
288+
configTime(tz, server1, server2, server3);
289+
}
290+
284291
#endif // __cplusplus
285292

286293
#include "pins_arduino.h"

cores/esp8266/coredecls.h

+2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ extern "C" {
1313
#include <cont.h> // g_pcont declaration
1414

1515
extern bool timeshift64_is_set;
16+
extern uint32_t sntp_real_timestamp;
1617

1718
bool can_yield();
1819
void esp_yield();
1920
void esp_schedule();
2021
void tune_timeshift64 (uint64_t now_us);
2122
void disable_extra4k_at_link_time (void) __attribute__((noinline));
23+
bool sntp_set_timezone_in_seconds(int32_t timezone);
2224

2325
uint32_t sqrt32 (uint32_t n);
2426
uint32_t crc32 (const void* data, size_t length, uint32_t crc = 0xffffffff);

0 commit comments

Comments
 (0)