rp2040 check for available pio instruction memory #381
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.