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

rp2040 check for available pio instruction memory #381

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bbacskay
Copy link

Hi All,

On the RP2040(W) the class caused a PANIC when I tried to use it together with another library that was also using the PIO. I initialized the other library first and it happened to use all of the instruction memory of pio0. The original code just checked for available SM, but not for pio memory.

I changed the rp2040 init code to check for available memory first on pio0, if that fails then it tries to load the pio program to pio1's memory and if that also fails then the raspberry SDK throws PANIC.
I also added clean up code to the destructor to free the pio resources.

This is a compatible change and effects only the rp2040 devices.

Probably already known limitation:
With the current pio program one rp2040 can only handle 8 Neopixel strips and the pio program is going to be loaded separately for each instance.

@bbacskay bbacskay marked this pull request as draft February 25, 2024 00:17
Strip did not work when rp2040 was used and the object was created with the constructor with parameters. (Output pin must be configured as output before the SM is started!)
@bbacskay bbacskay marked this pull request as ready for review February 25, 2024 05:48
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.

None yet

1 participant