Skip to content

NeoPixel Peripheral Memory Safety Improvements#380

Draft
dchansen06 wants to merge 10 commits intomainfrom
NeopixelFixes
Draft

NeoPixel Peripheral Memory Safety Improvements#380
dchansen06 wants to merge 10 commits intomainfrom
NeopixelFixes

Conversation

@dchansen06
Copy link
Copy Markdown
Contributor

NeoPixel Memory Safety

Problem and Scope

VLAs can cause stack overflows
Malloc is generally unnecessary

Description

Setup a inclusion-defined array for the color to bit mapping conversion

Gotchas and Limitations

Still does not do the conversion once transmitting starts which uses more memory but is faster

Testing

  • HOOTL testing
  • HITL testing
  • Human tested

Testing Details

Requires human testing

Larger Impact

Less likely to run out of memory unexpectedly

Additional Context and Ticket

Resolves #362

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
@dchansen06 dchansen06 added Documentation Improvements or additions to documentation Enhancement New feature or request Help | Review Extra attention is needed 1 URGENT Urgent issue that needs a quick action and resolution Small Fry Something that is small, could include bug fixes or smaller changes Peripheral Related to or involving a peripheral including abstractions Bug Something is doing a thing but doing it wrong or otherwise incorrectly labels Mar 28, 2026
@dchansen06 dchansen06 assigned dchansen06 and unassigned dchansen06 Mar 28, 2026
@dchansen06 dchansen06 requested review from Shrav816 and TurtleTest2 and removed request for TurtleTest2 March 28, 2026 11:05
Shrav816
Shrav816 previously approved these changes Mar 29, 2026
Copy link
Copy Markdown
Contributor

@Shrav816 Shrav816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Change warning to error for undefined `GR_NEOPIXEL_MAX_LEDS`

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
@dchansen06 dchansen06 marked this pull request as ready for review March 30, 2026 00:02
Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
@dchansen06 dchansen06 marked this pull request as draft March 31, 2026 05:05
@dchansen06
Copy link
Copy Markdown
Contributor Author

Potentially currently broken -- May also be a hardware issue, see Discord

The NeopixelFixes branch code is not running properly since we only see those first 4 leds light up as white

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 URGENT Urgent issue that needs a quick action and resolution Bug Something is doing a thing but doing it wrong or otherwise incorrectly Documentation Improvements or additions to documentation Enhancement New feature or request Help | Review Extra attention is needed Peripheral Related to or involving a peripheral including abstractions Small Fry Something that is small, could include bug fixes or smaller changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory Safety Within NeoPixel Peripheral Library

2 participants