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

Add parameterized 'timeout' to 'pulseIn' function #2158

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rkast
Copy link

@rkast rkast commented Jul 20, 2020

Problem

The 'pulseIn' function has a static 3 second timeout, I added another version to mimic Arduino. This has third parameter that specifies the number of microseconds to wait before timing out. Link to open issue is in 'Reference' section.

Solution

Adds addition parameter to a copied function and uses this value to calculate the number of systems ticks to wait, then uses this value in all of the timeout comparison statements

Steps to Test

This is my first contribution to Particle device-os, so I have yet to add testing

References

I'm new, so similar to the tests, I have yet to add an addition to the docs. But the opened issue can be found here:

https://github.com/particle-iot/device-os/issues/1379

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@rkast rkast changed the title first take on adding a timeout parameter to the pulseIn function Add parameterized 'timeout' to 'pulseIn' function Jul 20, 2020
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.

1 participant