Skip to content

fix(TX16SMK3): allow invert flag for BSP, invert SI and SJ#7425

Merged
pfeerick merged 1 commit into
mainfrom
3djc/mk3-sisj
Jun 4, 2026
Merged

fix(TX16SMK3): allow invert flag for BSP, invert SI and SJ#7425
pfeerick merged 1 commit into
mainfrom
3djc/mk3-sisj

Conversation

@3djc
Copy link
Copy Markdown
Collaborator

@3djc 3djc commented Jun 3, 2026

Make RM bsp handler able to handle hardware definition invert
Invert SI/SJ in MK3 hardware definitions

Successfully tested by RadioMaster

Fixes #7397

Needed for 2.12 too, but since it is not a cherry pic, I'll raise a separate PR

Summary by CodeRabbit

  • Bug Fixes
    • Fixed switch position polarity for specific switches.
    • Updated hardware interface to properly handle inverted switch positions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Switch position inversion support is added to the BSP I/O layer to invert switch readings conditionally. The TX16S MK3 hardware definition then marks switches SI and SJ as inverted, correcting their default position polarity to match the Mk2 and Companion software behavior.

Changes

Switch Position Inversion Support

Layer / File(s) Summary
Switch position inversion logic
radio/src/boards/rm-h750/bsp_io.cpp
_get_switch_pos() conditionally swaps SWITCH_HW_UP and SWITCH_HW_DOWN states when def->inverted is set, preserving mid and other positions.
TX16S MK3 switch configuration
radio/src/boards/hw_defs/tx16smk3.json
SI and SJ switches are marked as inverted to correct their default position representation on the hardware.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 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 The PR changes correctly implement the fix for issue #7397 by adding invert flag support to BSP and inverting SI/SJ switches, resolving the reversed default position problem.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the SI/SJ switch inversion issue for the RadioMaster TX16S MK3, with no out-of-scope modifications detected.
Title check ✅ Passed The title accurately describes the main changes: enabling invert flag support in BSP and inverting the SI and SJ switches.
Description check ✅ Passed The PR description addresses the template structure with a summary of changes and issue reference, though it lacks detail about the technical implementation.

✏️ 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/mk3-sisj

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: allow invert flag for BSP, invert SI and SJ fix(TX16SMK3): allow invert flag for BSP, invert SI and SJ Jun 3, 2026
@pfeerick pfeerick added this to the 3.0 milestone Jun 4, 2026
@pfeerick pfeerick merged commit 0a22fb9 into main Jun 4, 2026
39 checks passed
@pfeerick pfeerick deleted the 3djc/mk3-sisj branch June 4, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Additional switches SI & SJ on Radiomaster Mk3 default positions are reversed from Companion & Mk2

2 participants