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

Reduce measure errors #3

Merged
merged 2 commits into from
May 22, 2018
Merged

Reduce measure errors #3

merged 2 commits into from
May 22, 2018

Conversation

NdK73
Copy link
Contributor

@NdK73 NdK73 commented May 19, 2018

According to docs, pulseIn works better in noInterrupts() mode, so I added a critical section.
The float division is kept outside on purpose (it's slow and can run with interrupts enabled).

Moreover, there was an obvious copy-paste error in header file.

Hope it helps.

@gamegine gamegine merged commit 4ce2ba9 into gamegine:master May 22, 2018
@gamegine
Copy link
Owner

thank you
this is not specified on the arduino documentation

@NdK73
Copy link
Contributor Author

NdK73 commented May 22, 2018

Yup. I found it by chance while looking at wiring_pulse.c, to check if it used interrupts...

gamegine added a commit that referenced this pull request Mar 6, 2019
pulseIn works better in noInterrupts() thank to NdK73
gamegine added a commit that referenced this pull request Apr 19, 2019
pulseIn works better in noInterrupts() thank to NdK73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants