Init rtcBaseTime.tv_usec to 0

This commit is contained in:
LunaMoo 2017-05-23 22:58:46 +02:00
parent 00585e70ea
commit ea725e3b19

View File

@ -129,7 +129,7 @@ void __RtcInit()
timeval tv;
gettimeofday(&tv, NULL);
rtcBaseTime.tv_sec = tv.tv_sec;
rtcBaseTime.tv_usec = tv.tv_usec;
rtcBaseTime.tv_usec = 0;
// Precalculate the current time in microseconds (rtcMagicOffset is offset to 1970.)
rtcBaseTicks = 1000000ULL * rtcBaseTime.tv_sec + rtcBaseTime.tv_usec + rtcMagicOffset;
}