Open maruel opened 3 years ago
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.
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 https://github.com/google/periph/issues/384)