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

micros() wrap around #36

Closed
laurb9 opened this issue Nov 5, 2017 · 1 comment
Closed

micros() wrap around #36

laurb9 opened this issue Nov 5, 2017 · 1 comment
Labels
Milestone

Comments

@laurb9
Copy link
Owner

laurb9 commented Nov 5, 2017

In PanoController-Firmware which uses StepperDriver, program hangs if asked to move after running for a while (one hour or so).

micros() wraps around at 71 minutes, so it may be the most likely cause.

@laurb9 laurb9 added this to the 1.1.3 milestone Nov 5, 2017
@laurb9 laurb9 added the bug label Nov 5, 2017
@laurb9
Copy link
Owner Author

laurb9 commented Nov 5, 2017

Reference: https://www.gammon.com.au/millis

Summary: C wrapping math makes checking for millis() - startTime >= interval work better than millis() >= startTime + interval (which is what microWaitUntil() does). This doesn't explain the hang though (it only skips one interval).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant