Thanks to visit codestin.com
Credit goes to github.com

Skip to content

reset NeoPixels on soft reload on CPB, pybadge, and pygamer boards #2548

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

Merged
merged 2 commits into from
Jan 24, 2020

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jan 24, 2020

Fixes #2341. Soft-reload was not turning off NeoPixels on Circuit Playground Bluefruit.

  • Add code to CPB, pygamer boards, and pybadge boards board.c to turn off NeoPixels.
  • Refactor the port-independent NeoPixel reset code to avoid code duplication. Add supervisor/shared/board.c for such common code.
  • Allocate space on the stack for up to 24 NeoPixels in nrf neopixel_write/__init__.c to enable PWM-based NeoPixel writes without a VM but with the SoftDevice enabled. I chose 24 because it's less than 400 bytes on the stack, and will save a small amount of time for writes for up to 24 NeoPixels.

@dhalbert dhalbert requested a review from tannewt January 24, 2020 01:17
@dhalbert dhalbert changed the title reset NeoPixels on CPB on soft reload reset NeoPixels on soft reload on CPB, pybadge, and pygamer boards Jan 24, 2020
@dhalbert
Copy link
Collaborator Author

I realized that we weren't doing this on some other boards with user neopixel strings, and added them.

Working on this made me think there could be a board.NEOPIXEL_COUNT constant available on the boards that have on-board user neopixels. But that's a feature we could add later. Also, right now, pybadge (5 neopixels) and pybadge_lc (1 neopixel)` share the same build, so we'd need to split those builds.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks Dan!

@tannewt tannewt merged commit ad6e8ea into adafruit:master Jan 24, 2020
@dhalbert dhalbert deleted the cpb-reset-neopixels branch January 24, 2020 19:33
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.

NeoPixels do not turn off on Circuit Playground Bluefruit on REPL soft reboot
2 participants