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

gpio: refactor PWM to be context based #3

Open
maruel opened this issue May 16, 2021 · 1 comment
Open

gpio: refactor PWM to be context based #3

maruel opened this issue May 16, 2021 · 1 comment

Comments

@maruel
Copy link
Member

maruel commented May 16, 2021

Users forget to stop the PWM at the end of the program, causing user reports like #286 and #363.

We must design an API that makes it clear that the PWM blocking operation must be canceled before the termination of the program.

Discussion about this change is done in https://docs.google.com/document/d/1vQdZdoOMaIan7dKwcAzqHbfM_LCnnSMUQvqypRkjohM.

(ported from google/periph#384)

@1995parham
Copy link
Contributor

1995parham commented Oct 25, 2021

I have an idea about this, we can have a start function that is blocking and starting PWM so people need to close this function before the program's end and we can there defer the cancelation.

I can create a PR for this. also because we don't have any context in the periph package so using context for this specific function may be not a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants