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

WS2812: Support more than 7 pins in parallel mode #455

Merged

Conversation

adamgreen
Copy link
Contributor

@adamgreen adamgreen commented Dec 31, 2023

ws2812_parallel_program_init() contained an unneeded call to sm_config_set_set_pins(). When this is called with the pin_count parameter set to a value larger than 7, the set pin count value in the pinctrl register overflows into the side-set pin count. This can result in hard to diagnose issues where low numbered GPIO pins don't work as expected.

There is an existing valid_params_if() check in sm_config_set_set_pins() which would catch this error but it is ignored in Release builds.

This PR just removes this sm_config_set_set_pins() call as SET commands aren't even used by the associated PIO code.

Discovered when trying to explain symptoms noted in this forum thread

ws2812_parallel_program_init() contained an unneeded call to
sm_config_set_set_pins(). When this is called with the pin_count
parameter set to a value larger than 5, the set pin count value in the
pinctrl register overflows into the side-set pin count. This can result
in hard to diagnose issues where low numbered GPIO pins don't work as
expected.

There is an existing valid_params_if() check in sm_config_set_set_pins()
which would catch this error but it is ignored in Release builds.

This commit just removes this sm_config_set_set_pins() call as SET
commands aren't even used by the associated PIO code.

Discovered when trying to explain symptoms noted in this forum thread:
https://forums.raspberrypi.com/viewtopic.php?t=362071
@adamgreen adamgreen changed the title WS2812: Support more than 5 pins in parallel mode WS2812: Support more than 7 pins in parallel mode Jan 4, 2024
@kilograham kilograham merged commit 1545dfd into raspberrypi:develop Nov 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants