Skip to content

Incorrect wraparound handling #3

@chefables-mark

Description

@chefables-mark

https://github.com/aron-bordin/ArduinoTimerObject/blob/af372e79c3bca2899c07ca1e840a6e8836a48223/TimerObject.cpp#L68

Since you used unsigned variables, the math will work out correctly and you will get correct differences when subtracting across the wraparound.

This code should render your timers invalid when millis() is halfway to max since it will then overflow and have the wrong value.

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