Skip to content

feat(radio): add more power LED color overrides#7454

Open
qkdxorjs1002 wants to merge 1 commit into
EdgeTX:mainfrom
qkdxorjs1002:main
Open

feat(radio): add more power LED color overrides#7454
qkdxorjs1002 wants to merge 1 commit into
EdgeTX:mainfrom
qkdxorjs1002:main

Conversation

@qkdxorjs1002

@qkdxorjs1002 qkdxorjs1002 commented Jun 13, 2026

Copy link
Copy Markdown

Summary of changes:

Support additional POWER_LED_* build options and validate that only one color override is enabled at a time. Extend the generic STM32 LED driver to handle RGB combinations for yellow, magenta, and cyan. (except red)

IMG_5513

Summary by CodeRabbit

  • New Features
    • Expanded power LED color configuration options (Green, Cyan, Yellow, Magenta, White) in addition to Blue.
    • Added support for new LED color controls across multiple hardware platforms.
    • Status LED behavior now maps the selected power LED color into the corresponding error/end indication.
  • Bug Fixes
    • Build validation now ensures only one power LED color override is enabled at a time.
    • Added clearer build-time checks to prevent enabling power LED overrides without required status-LED support.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR expands power LED selection from blue-only to six compile-time colors. It adds RGB driver functions, board-specific declarations and startup wiring, status LED capability validation, strip support, and corrected option preprocessor conditionals.

Changes

Power LED Color Selection Extension

Layer / File(s) Summary
Build configuration for power LED colors
radio/src/CMakeLists.txt
Adds five color options, rejects multiple selections, and emits compile definitions for enabled colors.
LED driver RGB implementation and color functions
radio/src/boards/generic_stm32/led_driver.cpp, radio/src/boards/*/board.h, radio/src/targets/*/board.h, radio/src/targets/{pa01,pl18}/led_driver.cpp
Centralizes generic RGB GPIO control and adds yellow, magenta, cyan, and white functions for generic and strip-based drivers.
Board build and startup integration
radio/src/targets/{pa01,pl18}/CMakeLists.txt, radio/src/targets/pa01/board.cpp, radio/src/boards/{jumper-h750,rm-h750}/board.cpp
Enables STATUS_LED_STRIP for PA01 and PL18 and updates PA01 startup LED selection; remaining board edits are formatting-only.
Status LED macros and option wiring
radio/src/edgetx.h, radio/src/options.h
Maps configured colors to status LED behavior, validates color capabilities at compile time, and fixes POWER_LED conditional closures.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BuildConfiguration
  participant BoardStartup
  participant LEDDriver
  participant StatusLED
  BuildConfiguration->>BoardStartup: provide POWER_LED_* compile definition
  BoardStartup->>LEDDriver: call selected led{Color}()
  LEDDriver-->>BoardStartup: apply RGB output
  StatusLED->>LEDDriver: invoke LED_ERROR_END or LED_BIND mapping
Loading

Suggested reviewers: philmoz, richardclli

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: adding more configurable power LED color overrides.
Description check ✅ Passed The description includes a clear summary of the changes and aligns with the repository template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Support additional POWER_LED_* build options and validate that only one
color override is enabled at a time. Extend the generic STM32 LED driver
to handle RGB combinations for yellow, magenta, and cyan.
@pfeerick pfeerick changed the title feat(radio): add configurable power LED color overrides for H7 Remote feat(radio): add more configurable power LED color overrides Jul 14, 2026
@pfeerick pfeerick changed the title feat(radio): add more configurable power LED color overrides feat(radio): add more power LED color overrides Jul 14, 2026
@pfeerick pfeerick added the enhancement ✨ New feature or request label Jul 14, 2026
@pfeerick pfeerick added this to the 3.0 milestone Jul 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@radio/src/edgetx.h`:
- Around line 618-620: In the LED macro fallback `#else` block, add a LED_BIND()
definition alongside LED_ERROR_END(). Assign it the appropriate fallback LED
color used by this branch so callers such as bind_button_driver.cpp compile
successfully when no green LED is available.
- Around line 594-596: Add a capability validation branch alongside the existing
POWER_LED_GREEN check in the preprocessor configuration, using POWER_LED_BLUE
and the board’s corresponding blue-LED capability macro. Emit a compile-time
error when POWER_LED_BLUE is explicitly enabled without supported blue LED
hardware, while preserving the existing green validation.

In `@radio/src/targets/pa01/board.cpp`:
- Around line 389-393: Replace the conditional power-LED selection in
radio/src/targets/pa01/board.cpp lines 389-393 and
radio/src/boards/rm-h750/board.cpp lines 171-175 with exhaustive preprocessor
mapping: each POWER_LED_BLUE, POWER_LED_GREEN, POWER_LED_YELLOW,
POWER_LED_MAGENTA, POWER_LED_CYAN, and POWER_LED_WHITE macro must invoke its
corresponding led*() function, preserving the correct selection for every
supported color.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba996555-5310-4b85-b904-20f50de4f51b

📥 Commits

Reviewing files that changed from the base of the PR and between ddb9804 and 53a95a3.

📒 Files selected for processing (17)
  • radio/src/CMakeLists.txt
  • radio/src/boards/generic_stm32/led_driver.cpp
  • radio/src/boards/jumper-h750/board.cpp
  • radio/src/boards/jumper-h750/board.h
  • radio/src/boards/rm-h750/board.cpp
  • radio/src/boards/rm-h750/board.h
  • radio/src/edgetx.h
  • radio/src/options.h
  • radio/src/targets/horus/board.h
  • radio/src/targets/pa01/CMakeLists.txt
  • radio/src/targets/pa01/board.cpp
  • radio/src/targets/pa01/board.h
  • radio/src/targets/pa01/led_driver.cpp
  • radio/src/targets/pl18/CMakeLists.txt
  • radio/src/targets/pl18/board.h
  • radio/src/targets/pl18/led_driver.cpp
  • radio/src/targets/st16/board.h
🚧 Files skipped from review as they are similar to previous changes (5)
  • radio/src/options.h
  • radio/src/boards/rm-h750/board.h
  • radio/src/boards/generic_stm32/led_driver.cpp
  • radio/src/boards/jumper-h750/board.h
  • radio/src/CMakeLists.txt

Comment thread radio/src/edgetx.h
Comment thread radio/src/edgetx.h
Comment thread radio/src/targets/pa01/board.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants