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

Added code for static arrays #370

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

Conversation

philm001
Copy link

@philm001 philm001 commented Nov 5, 2023

Added in provision to incorporate the use of static arrays for LEDs. I was working on a project that used 11 different strips of Neo pixels (this was the 144 LED/m where it is recommended to use only 1 meter at a time). Since I used 11 strips, I needed 11 different instances of the Adafruit class and with this being dynamic memory on a MCU, this killed my heap. Even the ESP32 had a hard time.

But, once I removed the dynamic aspect from the library, everything worked. This code will be valuable to those that use more then 1 strip. I also have default arguments to be backward compatible with existing code.

@philm001
Copy link
Author

So any update on this......

@dhalbert
Copy link
Contributor

It looks like the storage is allocated in the constructor and deallocated in the destructor. Are you constructing/destructing over and over again, or just once and your ran out of heap? Did you shared the buffer between multiple instances to avoid that?

It would be good to pass the length of the buffer and validate that it's at least as big as what's required.

@philm001
Copy link
Author

philm001 commented Feb 3, 2025

Hello, thank you for getting back. I haven't look at the code in awhile so will need to check and get back to you

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