Skip to content

Commit 7f6e0c9

Browse files
committed
core: fix bug in gettimeofday
gettimeofday used to return timestamps which had tv_sec 1000 times smaller than the correct value. s_bootTime is in seconds, so no need to divide it by 1000.
1 parent 35ee060 commit 7f6e0c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp8266/time.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int _gettimeofday_r(struct _reent* unused, struct timeval *tp, void *tzp)
9797
if (tp)
9898
{
9999
ensureBootTimeIsSet();
100-
tp->tv_sec = (s_bootTime + millis()) / 1000;
100+
tp->tv_sec = s_bootTime + millis() / 1000;
101101
tp->tv_usec = micros() * 1000;
102102
}
103103
return 0;

0 commit comments

Comments
 (0)