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

Compare time differences instead of timestamps #1648

Merged

Conversation

flo-x
Copy link
Contributor

@flo-x flo-x commented May 20, 2023

Compare time differences instead of timestamps

Description:

Comparing two results of millis() can result in erroneous behavior when the value of millis() wraps around, which happens after around 25 days of uptime. Comparing time difference (by subtracting two timestamps) works well, provided timestamps are not too old (less than 25 days old).

Checklist:

  • [ X] The pull request is done against the latest development branch
  • [ X] Only one feature/fix was added per PR and the code change compiles without warnings
  • [ X] I accept the DCO.

@1technophile
Copy link
Owner

Thanks for the PR, for code format, right click on the code from VSC, "Format document"

Comparing two results of millis() can result in erroneous
behavior when the value of millis() wraps around, which
happens after around 25 days of uptime. Comparing time
difference (by subtracting two timestamps) works well, provided
timestamps are not too old (less than 25 days old).
@flo-x flo-x force-pushed the adc-timing-fix-pr branch from 9ac68c7 to 67a5fad Compare May 22, 2023 17:57
@1technophile
Copy link
Owner

thanks

@1technophile 1technophile merged commit 5b85c74 into 1technophile:development May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants