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 countio #4254

Merged
merged 6 commits into from
Mar 3, 2021
Merged

Rp2040 countio #4254

merged 6 commits into from
Mar 3, 2021

Conversation

gamblor21
Copy link
Member

Adding countio to RP2040. This build uses the PWM IRQ that does not seem in use in the PWM module. If the PWM module started to use it there could be a conflict.

@tannewt tannewt self-requested a review February 24, 2021 18:29
@tannewt tannewt added enhancement rp2040 Raspberry Pi RP2040 labels Feb 24, 2021
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for this! The logic looks good except for storing the object. It won't work with multiple counters running at once. Suggestions inline.

ports/raspberrypi/common-hal/countio/Counter.c Outdated Show resolved Hide resolved
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for the update! It looks good. However, I thought of another case that probably needs to be handled. We likely need to set one of the globals from PWMOut so that it doesn't allocate to the channel A pin at the same time. Could you try making a countio and then making a PWMOut on the other pin? It should error. Thanks!

@dhalbert dhalbert requested a review from tannewt March 3, 2021 15:35
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@tannewt tannewt merged commit 514b73b into adafruit:main Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rp2040 Raspberry Pi RP2040
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants