-
Notifications
You must be signed in to change notification settings - Fork 167
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
esp-hal-smartled: Calculate RMT cycles from runtime clock config #1154
Conversation
Thanks for taking care of this! I will give this a proper review and test it on hardware for all supported chips on Monday when I'm back to work. |
IMPORTANT: current
|
@playfulFence thanks for testing, I guess if it happens on main then we can go ahead and merge this. I'll create an issue tracking the other bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My ESP32 devkit does not have a smart LED unfortunately, so I'm unable to confirm for this device. The remaining chips seems to be working, however, so LGTM.
I will open an issue regarding the ESP32. As @MabezDev said, if this already happens in main
then I won't block this PR based on that.
Thanks for the contribution! And thanks for testing @playfulFence!
This replaces the hard-coded RMT cycle counts in the smartled driver with runtime calculations from the clock config. It resolves this TODO.
I've maintained the assumption that the RMT clock source is set to the APB, as it is by default (verified using the patch at the bottom of this PR). The only change to the calculation from the original is the final divisor (500 → 1000) as the original constants were half of the actual APB clock.
All my testing was done exclusively on an ESP32-S3 since that's what I've got on hand. The numbers do work out for the other chips, though.
I have not added anything to the changelog since it's not part of
esp-hal-common
/esp-hal
and is a pretty small change anyway. Happy to add it if that's wanted.errors
orwarnings
.cargo fmt
was run.CHANGELOG.md
in the proper section.