File tree 1 file changed +3
-4
lines changed 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ extern struct tm* sntp_localtime(const time_t *clock);
35
35
#define DIFF1900TO1970 2208988800UL
36
36
37
37
static int s_daylightOffset_sec = 0 ;
38
- static int s_timezone_sec = 0 ;
38
+ static long s_timezone_sec = 0 ;
39
39
static time_t s_bootTime = 0 ;
40
40
41
41
// calculate offset used in gettimeofday
@@ -46,7 +46,7 @@ static void ensureBootTimeIsSet()
46
46
time_t now = sntp_get_current_timestamp ();
47
47
if (now )
48
48
{
49
- s_bootTime = - millis () / 1000 ;
49
+ s_bootTime = now - millis () / 1000 ;
50
50
}
51
51
}
52
52
}
@@ -56,7 +56,7 @@ static void setServer(int id, const char* name_or_ip)
56
56
if (name_or_ip )
57
57
{
58
58
//TODO: check whether server is given by name or IP
59
- sntp_setservername (0 , (char * ) name_or_ip );
59
+ sntp_setservername (id , (char * ) name_or_ip );
60
60
}
61
61
}
62
62
@@ -92,7 +92,6 @@ time_t mktime(struct tm *t)
92
92
time_t time (time_t * t )
93
93
{
94
94
time_t seconds = sntp_get_current_timestamp ();
95
- ensureBootTimeIsSet ();
96
95
if (t )
97
96
{
98
97
* t = seconds ;
You can’t perform that action at this time.
0 commit comments