Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix time gap with RTC millis() overflow #1167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 16, 2024

  1. Fix time gap with RTC millis() overflow

    The millis state was internally represented with a 32 bit number, using
    timer_overflow_count as the high 16 bits, and RTC.CNT as the low 16
    bits. The max value before overflow was 0xFFFFFFFF (or 4294967295) which
    corresponded to about 4194303999ms given the timer's frequency of
    1024Hz. But then, one millisecond later, after overflow, the internal
    value 0x0 would correspond to 0ms, skipping all millisecond values
    between (inclusive) 4194304000 and 2^32-1, causing an apparent time warp
    into the future by 100663296ms or 28 hours.
    
    After this commit, the internal representation is in milliseconds, which
    results in no time warp.
    jvasileff committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    3dd26f0 View commit details
    Browse the repository at this point in the history