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

boards/adafruit-itsybitsy-m4: turn off APA102 LED on startup #19357

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Mar 7, 2023

Contribution description

adafruit-itsybitsy-m4 comes with a serial APA102 that is left on by the bootloader.
It's really bright and the only way to turn it off is by communication with it through it's SPI interface.

We have a proper driver for it, but pulling that in unconditionally feels wrong.

Instead just bit-bang the simple protocol on startup set all colors + alpha to 0.

Testing procedure

  • adafruit-itsybitsy-m4 no longer glows blindingly pink.
  • tests/driver_apa102 still does it's fading

Issues/PRs references

@benpicco benpicco force-pushed the boards/adafruit-itsybitsy-m4_led branch 2 times, most recently from 549caa6 to 562da97 Compare March 7, 2023 00:25
@github-actions github-actions bot added the Area: boards Area: Board ports label Mar 7, 2023
@benpicco benpicco changed the title Boards/adafruit itsybitsy m4 led boards/adafruit-itsybitsy-m4: turn off APA102 LED on startup Mar 7, 2023
@benpicco benpicco added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 7, 2023
@riot-ci
Copy link

riot-ci commented Mar 7, 2023

Murdock results

✔️ PASSED

ff7227d boards/adafruit-itsybitsy-m4: turn off APA102 LED on startup

Success Failures Total Runtime
525 0 525 03m:00s

Artifacts

@benpicco benpicco force-pushed the boards/adafruit-itsybitsy-m4_led branch from 562da97 to a55db80 Compare March 7, 2023 09:29
@benpicco benpicco requested a review from maribu March 9, 2023 13:15
@maribu
Copy link
Member

maribu commented Mar 9, 2023

Does this still work with LTO? It looks like the overhead of a function call is enough to not have the SPI clock too high, but wit LTO enabled the SPI clock may be well out of spec.

@benpicco
Copy link
Contributor Author

benpicco commented Mar 9, 2023

Yes I tried with

make BOARD=adafruit-itsybitsy-m4 LTO=1 flash term

and the LED still gets turned off.

@benpicco benpicco requested a review from fabian18 March 15, 2023 10:01
@benpicco benpicco force-pushed the boards/adafruit-itsybitsy-m4_led branch from a55db80 to 23adb1a Compare March 16, 2023 15:44
@maribu
Copy link
Member

maribu commented Mar 16, 2023

I'm still worried that optimization in the GPIO driver might result in timing issues. But if you add a comment to ease debugging in case this indeed happens, I'm fine with the ostrich algorithm on SPI clock generation here :)

@benpicco benpicco force-pushed the boards/adafruit-itsybitsy-m4_led branch from 23adb1a to ff7227d Compare March 16, 2023 16:13
@benpicco
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 16, 2023

Build succeeded:

@bors bors bot merged commit c4400e8 into RIOT-OS:master Mar 16, 2023
@benpicco benpicco deleted the boards/adafruit-itsybitsy-m4_led branch March 16, 2023 22:59
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants