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

Switch to pin, frequency and duty_cycle PulseOut #5067

Merged
merged 6 commits into from Jul 28, 2021

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Jul 27, 2021

Passing in a PWMOut still works but is deprecated. It will be
removed in CircuitPython 8.0.0

This also switches STM32 timer indices and channel indices to
0-based in our pin data rather than - 1 everywhere. The latter is
more bug prone.

Most of the way for #3264

Tested on Metro M0, Metro M4, Feather S2, Feather nRF52840, Feather
STM32F4 and Arduino RP2040.

Passing in a PWMOut still works but is deprecated. It will be
removed in CircuitPython 8.0.0

This also switches STM32 timer indices and channel indices to
0-based in our pin data rather than `- 1` everywhere. The latter is
more bug prone.

Most of the way for micropython#3264

Tested on Metro M0, Metro M4, Feather S2, Feather nRF52840, Feather
STM32F4 and Arduino RP2040.
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

This looks good (not tested). I have one q about type annotation.

shared-bindings/pulseio/PulseOut.c Show resolved Hide resolved
@dmcomm
Copy link

dmcomm commented Jul 27, 2021

#5016 has returned for both variants of the constructor. (#4908 seems OK including with high frequency and 100% duty cycle.)

@dhalbert
Copy link
Collaborator

I'm fine with your answer about the stubs. Will await possible changes to re-fix #5016, as @dmcomm noted.

@tannewt
Copy link
Member Author

tannewt commented Jul 27, 2021

Thanks for the test @dmcomm I think that issue is a race between setting a new duty_cycle and disabling the timer. I switched to using the gpio mux to control PWM output. Please let me know how well it works for you. Thanks!

@dmcomm
Copy link

dmcomm commented Jul 28, 2021

The pin seems to be an input where it was driving low previously.

@tannewt
Copy link
Member Author

tannewt commented Jul 28, 2021

The pin seems to be an input where it was driving low previously.

Ah! I should have thought of that. Should be fixed now.

@dmcomm
Copy link

dmcomm commented Jul 28, 2021

Great, I think everything is working on Pi Pico!

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

👍 based on @dmcomm's testing.

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.

None yet

3 participants