[PR #290] feat: configurable status LEDs (modes & roles) with Web UI controls #273

Open
opened 2026-10-22 05:08:34 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/290
Author: @ripps818
Created: 9/14/2026
Status: 🔄 Open

Base: main ← Head: status-led


📝 Commits (4)

  • a1849cf feat: add status LED indicators for connection and pairing states
  • 5bd98f3 feat: add status LED configuration and web UI controls
  • d34e828 docs: document status LED WebUI configuration and protocol v22
  • 1c92d03 feat: support independent per-pin polarity, behavior, and hardware presets for status LEDs

📊 Changes

10 files changed (+468 additions, -38 deletions)

View changed files

📝 ARCHITECTURE.md (+8 -4)
📝 OpenPuck/config.cpp (+33 -1)
📝 OpenPuck/rf_link.cpp (+23 -0)
📝 OpenPuck/rf_link.h (+1 -0)
📝 OpenPuck/status_led.cpp (+127 -14)
📝 OpenPuck/status_led.h (+42 -12)
📝 OpenPuck/webusb_config.cpp (+59 -3)
📝 README.md (+11 -1)
📝 docs/PROTOCOL.md (+11 -1)
📝 docs/index.html (+153 -2)

📄 Description

Resolves https://github.com/safijari/openpuck/issues/284

Summary

Adds configurable status LED support to indicate dongle state (disconnected/advertising, connected, wake indication, heartbeat, solid on/off). LEDs are fully configurable at runtime via WebUSB and saved to flash memory across reboots.

Key Changes

  • Board Presets: Built-in presets for popular nRF52840 boards (SuperMini / Nice!Nano, Nordic Dongle PCA10059, Adafruit Feather nRF52840) with hardware-correct default pins and active polarities.
  • Independent Dual-LED Control: Custom GPIO mode supports configuring up to two LEDs (Primary & Secondary) with independent behaviors and polarities (Active-High / Active-Low).
  • Behavior Modes:
    • Status: Fast blink while advertising / searching; slow pulse / breath when connected.
    • Heartbeat: Periodic alive blink.
    • Wake Only: Illuminates briefly upon controller wake / activity.
    • Solid On & Off.
  • WebUSB & WebUI:
    • Dedicated configuration card with instant "Test LED" pulse trigger.
    • Prevents UI state resets while editing custom GPIO pin numbers.
  • Protocol & Storage:
    • WebUSB commands: 32 (Mode A), 33 (Pin A), 90 (Pin B), 91 (Polarity A), 92 (Test Pulse), 93 (Mode B), 94 (Polarity B).
    • Appends to flash configuration tail to preserve backwards compatibility with existing stored configs.
    • Protocol bumped to v22 and documented in docs/PROTOCOL.md.

Verification

  • make check: Passes clang-format 18 and trailing-comment lint checks.
  • make build: Clean compilation with 0 warnings/errors.
  • Verified WebUSB read/write, test pulse, and flash persistence across device resets.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/290 **Author:** [@ripps818](https://github.com/ripps818) **Created:** 9/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `status-led` --- ### 📝 Commits (4) - [`a1849cf`](https://github.com/safijari/openpuck/commit/a1849cfce23360a66d957f95ab01e4b3c5a3a24d) feat: add status LED indicators for connection and pairing states - [`5bd98f3`](https://github.com/safijari/openpuck/commit/5bd98f302742768e82d6550776d4ee8e4b3a8b83) feat: add status LED configuration and web UI controls - [`d34e828`](https://github.com/safijari/openpuck/commit/d34e828b573a55c7e6200c73efa8875c7673b0a9) docs: document status LED WebUI configuration and protocol v22 - [`1c92d03`](https://github.com/safijari/openpuck/commit/1c92d03b44a90d07c861f810f7646a0e1ce81b6d) feat: support independent per-pin polarity, behavior, and hardware presets for status LEDs ### 📊 Changes **10 files changed** (+468 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `ARCHITECTURE.md` (+8 -4) 📝 `OpenPuck/config.cpp` (+33 -1) 📝 `OpenPuck/rf_link.cpp` (+23 -0) 📝 `OpenPuck/rf_link.h` (+1 -0) 📝 `OpenPuck/status_led.cpp` (+127 -14) 📝 `OpenPuck/status_led.h` (+42 -12) 📝 `OpenPuck/webusb_config.cpp` (+59 -3) 📝 `README.md` (+11 -1) 📝 `docs/PROTOCOL.md` (+11 -1) 📝 `docs/index.html` (+153 -2) </details> ### 📄 Description Resolves https://github.com/safijari/openpuck/issues/284 ### Summary Adds configurable status LED support to indicate dongle state (disconnected/advertising, connected, wake indication, heartbeat, solid on/off). LEDs are fully configurable at runtime via WebUSB and saved to flash memory across reboots. ### Key Changes - **Board Presets**: Built-in presets for popular nRF52840 boards (SuperMini / Nice!Nano, Nordic Dongle PCA10059, Adafruit Feather nRF52840) with hardware-correct default pins and active polarities. - **Independent Dual-LED Control**: Custom GPIO mode supports configuring up to two LEDs (Primary & Secondary) with independent behaviors and polarities (Active-High / Active-Low). - **Behavior Modes**: - `Status`: Fast blink while advertising / searching; slow pulse / breath when connected. - `Heartbeat`: Periodic alive blink. - `Wake Only`: Illuminates briefly upon controller wake / activity. - `Solid On` & `Off`. - **WebUSB & WebUI**: - Dedicated configuration card with instant "Test LED" pulse trigger. - Prevents UI state resets while editing custom GPIO pin numbers. - **Protocol & Storage**: - WebUSB commands: `32` (Mode A), `33` (Pin A), `90` (Pin B), `91` (Polarity A), `92` (Test Pulse), `93` (Mode B), `94` (Polarity B). - Appends to flash configuration tail to preserve backwards compatibility with existing stored configs. - Protocol bumped to v22 and documented in `docs/PROTOCOL.md`. ### Verification - `make check`: Passes `clang-format 18` and trailing-comment lint checks. - `make build`: Clean compilation with 0 warnings/errors. - Verified WebUSB read/write, test pulse, and flash persistence across device resets. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#273
No description provided.