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

drivers: pwm: rpi_pico: Convert clk calculations to fixed-point #80257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

d3zd3z
Copy link
Collaborator

@d3zd3z d3zd3z commented Oct 22, 2024

Remove the use of floating point to calculate in
pwm_rpi_get_cycles_per_sec to fixed point calculations that result in the same value. There is still a division here, which is somewhat slow still, but the end result about twice fast for the whole path through the led pwm code.

Even better would be to cache these values, since there is no interface in this driver to change the configuration past init time.

Remove the use of floating point to calculate in
`pwm_rpi_get_cycles_per_sec` to fixed point calculations that result in the
same value.  There is still a division here, which is somewhat slow still,
but the end result about twice fast for the whole path through the led pwm
code.

Even better would be to cache these values, since there is no interface in
this driver to change the configuration past init time.

Signed-off-by: David Brown <[email protected]>
@d3zd3z d3zd3z requested a review from soburi October 22, 2024 19:48
@zephyrbot zephyrbot added platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) area: PWM Pulse Width Modulation labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: PWM Pulse Width Modulation platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants