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

Rp2040 pulsein improvements #6450

Merged

Conversation

mwisslead
Copy link

I was working on issue #4664 but I found a few other small issues and instead of opening issues for each I hoped it would be ok if I just submitted one pull request that addressed them all. I tested these changes with a dht22, an ir remote and an rcwl-1601 and all work as expected. Below is a list of changes.

Fixes #4664
Addresses #4946 since just dropping short pulses isn't a valid way to filter out short pulses
Fixes a buffer start index reset bug on line 160 I missed before
Fixes lost counts when state machine is reset unnecessarily
Fixes missing initial count on pin value change line 143
Removes delay after resume pulse
Fix popleft resetting level count
Removes unneeded buf_index
Add call to pause at the beginning of resume
Adds paused attribute to fix .paused always returning true.
Remove unneeded resets of start pointer in .clear and .popleft.

@tannewt
Copy link
Member

tannewt commented Jun 1, 2022

@DavePutz Would you like to review this?

@DavePutz
Copy link
Collaborator

DavePutz commented Jun 2, 2022

I'm currently in Alaska, but will review after returning on Sunday.

@tannewt
Copy link
Member

tannewt commented Jun 2, 2022

Thanks @DavePutz! Sorry for bugging you while you are away.

@ladyada ladyada requested a review from DavePutz June 5, 2022 20:32
Copy link
Collaborator

@DavePutz DavePutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested changes with a DHT11 and an Adafruit mini remote control. Everything looks good to me.

@tannewt tannewt merged commit 9c20eb5 into adafruit:main Jun 8, 2022
@mwisslead mwisslead deleted the rp2040_pulsein_common_hal_construct branch June 8, 2022 17:59
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.

RP2040 PulseIn should use common-hal methods of state machine construction
3 participants