Skip to content

millis() wrap #4

Open
Open
@irekzielinski

Description

@irekzielinski

After 49 days of running, millis() wraps and SimpleTimer logic will be broken (will fire at wrong time).
Check for this condition is needed.

for example:

        if (current_millis - prev_millis[i] >= delays[i]) {

if:
prev_millis[0] == 4,294,967,290 (just 5 mills from wrap over)
current_millis == 1 (just after wrap over)

"if" statement above will be satisfied for almost any delays[0] value.
this will lead to timer being fired pre-maturely

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions