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

[beken-72xx] Pause PWM instead of stopping, track PWM state #222

Merged
merged 2 commits into from
Dec 16, 2023

Conversation

szupi-ipuzs
Copy link
Contributor

This seems to resolve issues that occured when pwm was stopped on N-chips.
Instead of stopping, we should do pause (ie. "unit disable"), when duty cycle is 0.
I couldn't make it work using "CMD_PWM_UNIT_DISABLE" and then "CMD_PWM_UNIT_ENABLE", as "disabling" seems to do some additional cleanup for some reason. Although it seems to be working fine with "CMD_PWM_INIT_PARAM" instead of "enabling".

I decided it will be easier to track the state as an enum, so that now it's clear when we should (re)start and/or pause or do full stop.

@szupi-ipuzs
Copy link
Contributor Author

I was finally able to test this PR with a T-device and PWM seems to work fine there too.
Do you need need anything else to merge this?

@kuba2k2 kuba2k2 added bug Something isn't working BK7231 Beken BK72xx family labels Dec 16, 2023
@kuba2k2 kuba2k2 changed the title Pwm pause [beken-72xx] Pause PWM instead of stopping, track PWM state Dec 16, 2023
@kuba2k2 kuba2k2 merged commit eed39c9 into libretiny-eu:master Dec 16, 2023
2 checks passed
@szupi-ipuzs szupi-ipuzs deleted the pwm_pause branch December 16, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BK7231 Beken BK72xx family bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants