Skip to content

feat: drive RGB status LED from system state (PR 4/9) - #39

Merged
thePunderWoman merged 1 commit into
mainfrom
firmware-rewrite/pr4-rgb-status-led
Sep 7, 2026
Merged

feat: drive RGB status LED from system state (PR 4/9)#39
thePunderWoman merged 1 commit into
mainfrom
firmware-rewrite/pr4-rgb-status-led

Conversation

@thePunderWoman

Copy link
Copy Markdown
Owner

Summary

PR 4 of the firmware rewrite (PR 1: #35, PR 2: #36, PR 3: #38). Adds the SK6812 status LED per PCB/GPIO_table.md (pin 37, RMT-driven).

  • StatusLedController (include/status_led.h / src/status_led.cpp): pure logic mapping a SystemState (booting/connected/disconnected/charging/error) to an RGB color, fully unit tested.
  • RgbLed (include/rgb_led.h / src/rgb_led.cpp): thin Adafruit_NeoPixel adapter — shows whatever color it's given, no state decisions. Joins oled.cpp in the native build/coverage exclusion list.
  • SnipsController.ino cycles through every status color once at boot, matching the bring-up check PCB/README.md's recommended order calls for ("verify RMT output on pin 37, cycle colors"), then settles on "disconnected" — accurate for now since the XBee link doesn't exist until PR 8. Real state (connected/charging/error) gets wired up once there's something to base it on.

Test plan

  • pio test -e native — all 30 test cases pass
  • gcovr --exclude 'src/SnipsController\.ino' --exclude 'src/oled\.cpp' --exclude 'src/rgb_led\.cpp' --fail-under-line 90 — 100% across all logic files
  • pio run -e esp32s3 — builds successfully, Adafruit NeoPixel lib resolves and links
  • Flash to real hardware once boards arrive: confirm the LED cycles blue → green → yellow → orange → red once at boot, then settles on yellow (disconnected)

🤖 Generated with Claude Code

Adds the SK6812 status LED per PCB/GPIO_table.md (pin 37, RMT-driven).
Same split as the OLED work in PR 3: StatusLedController
(status_led.h/.cpp) is pure logic mapping SystemState
(booting/connected/disconnected/charging/error) to an RGB color, fully
unit tested; RgbLed (rgb_led.cpp) is a thin Adafruit_NeoPixel adapter
that just shows whatever color it's given. rgb_led.cpp joins the native
build/coverage exclusion list alongside oled.cpp.

SnipsController.ino cycles through every status color once at boot —
the bring-up check PCB/README.md's recommended order calls for ("verify
RMT output on pin 37, cycle colors") — then settles on "disconnected,"
which is accurate until the XBee link exists (PR 8). Real state
(connected/charging/error) gets wired up by later PRs once there's
something to base it on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant