From 646d60e9c5e85ddadc5eb83eec2feebc95c3e10e Mon Sep 17 00:00:00 2001 From: Marius Gripp Date: Mon, 13 May 2019 14:30:56 +0200 Subject: [PATCH] t_sec corrected by one seconds because time is only set ontop of a second --- src/timesync.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/timesync.cpp b/src/timesync.cpp index 2c5b5db0..fa2030b2 100644 --- a/src/timesync.cpp +++ b/src/timesync.cpp @@ -208,8 +208,10 @@ int recv_timesync_ans(uint8_t seq_no, uint8_t buf[], uint8_t buf_len) { } // adjust system time, calibrate RTC and RTC_INT pps -void IRAM_ATTR setMyTime(uint32_t t_sec, uint16_t t_msec, - timesource_t mytimesource) { +void IRAM_ATTR setMyTime(uint32_t t_sec, uint16_t t_msec) { + + t_sec ++; + time_t time_to_set = (time_t)(t_sec); // increment t_sec only if t_msec > 1000 time_t time_to_set = (time_t)(t_sec + t_msec / 1000);