Skip to content

fix: derive SWSERIALPOWER from hardware capabilities#7392

Open
3djc wants to merge 1 commit into
mainfrom
3djc/serialpower
Open

fix: derive SWSERIALPOWER from hardware capabilities#7392
3djc wants to merge 1 commit into
mainfrom
3djc/serialpower

Conversation

@3djc
Copy link
Copy Markdown
Collaborator

@3djc 3djc commented May 25, 2026

automagicaly define SWSERIALPOWER, so that lua serialSetPower() is available everywhere a compatible hardware exists

Fixes #7389

Summary by CodeRabbit

  • Chores
    • Modified serial power configuration handling to determine settings based on hardware GPIO availability rather than build configuration.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

📝 Walkthrough

Walkthrough

Serial power configuration for auxiliary serial ports is relocated from CMake-based build flags tied to PCB revisions into automatic hardware-driven detection via GPIO macro availability. The header file now defines SWSERIALPOWER when appropriate GPIO definitions exist, and the CMake build file removes all related flag assignments and conditional compilation.

Changes

Serial Power Configuration Refactoring

Layer / File(s) Summary
Hardware-driven SWSERIALPOWER definition
radio/src/hal/serial_port.h
A preprocessor conditional defines SWSERIALPOWER automatically when AUX_SERIAL_PWR_GPIO or AUX2_SERIAL_PWR_GPIO is defined, replacing the previous build-time configuration approach.
Remove CMake-based SWSERIALPOWER configuration
radio/src/targets/horus/CMakeLists.txt
Removed two SWSERIALPOWER flag assignments from PCB revision branches and the conditional block that added the -DSWSERIALPOWER compile definition, completing the transition to header-based configuration.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the purpose (auto-define SWSERIALPOWER for Lua serialSetPower availability) and references the linked issue #7389.
Linked Issues check ✅ Passed The changes enable serialSetPower() availability on compatible hardware by automatically defining SWSERIALPOWER based on GPIO presence, directly addressing issue #7389's requirement for parity between Mk2 and Mk3.
Out of Scope Changes check ✅ Passed All changes are scoped to the SWSERIALPOWER definition mechanism: header macro addition and CMake build flag removal—both directly supporting the objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title directly reflects the main change: automatically deriving SWSERIALPOWER from hardware capabilities instead of manual CMake configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3djc/serialpower

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 and usage tips.

@3djc 3djc changed the title fix: derive SWSERIALPOWER for hardware capabilities fix: derive SWSERIALPOWER from hardware capabilities May 25, 2026
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.

Lua serialSetPower(port_nr, value) works on Radiomaster Mk2 but does not work on Mk3

1 participant