-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32/machine_pwm.c: Add support for all PWM timers and channels. #7817
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
Conversation
Add pwm.rst with more comprehensive example.
If you click at the 'details' link of the fails checks, you'll see what is wrong. For code formatting, the lines preceded with a + show how it should look like, and the line starting with - show how the code looks at t he moment. |
@robert-hh Thank you |
As for me, it is an horrible code formatting style:
I'd prefer like this:
:( |
Nevertheless. Could someone check the performance of the PR on ESP32 |
Tested GENERIC on TinyPICO, GENERIC_S2 on FeatherS2, and GENERIC_C3 on ESP32-C3-DevKitC. PWM works as expected. |
This pull request allows using all the available PWM timers (up to 8) and channels(up to 16),
without affecting the PWM API.
If a new frequency is set, first it checks if another timer is using
the same freq.
If yes, then it uses this timer, otherwise, it creates a new one.
If all timers are used, the user should set an already used frequency,
or de-init a channel.
This PR is based on #6276 and #3608.
Thanks, @p1ng0o
Thanks, @dragomirecky
Thanks, @dpgeorge
Tested on ESP WROOM 32
Need to test on ESP32 GENERIC_S2 and GENERIC_C3 boards.