Skip to content

fix(v15): IMU axis orientation and function switch handling - #7890

Merged
pfeerick merged 3 commits into
mainfrom
pfeerick/v15-imu-fs-fix
Oct 10, 2026
Merged

pfeerick merged 3 commits into
mainfrom
pfeerick/v15-imu-fs-fix

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 9, 2026

Copy link
Copy Markdown
Member

Two HelloRadioSky V15 fixes found during hardware testing after #7867. The same fixes are in the 2.12 port (#7868).

IMU axis orientation

The IMU is mounted face down (flipped about its X=−Y diagonal), so TltX followed the Y tilt and TltY the X tilt, both reversed. The board's IMU read now swaps X/Y before the generic inversion and calibration, so the X/Y invert settings and calibration stay attached to the right tilt source. imu_invert_x/y already inverts both axes by default.

Function switches / phantom S3

The six function switch buttons are a resistor ladder on PC5, decoded by sixPosUpdateFromAdc().

  • V15 declared that input as P3, a FLEX pot with a MULTIPOS default, so a meaningless S3 appeared in sources, calibration and Lua. It is now RAW1, as on V12, at the same ADC index, so SIXPOS_SWITCH_INDEX is unchanged.
  • V15's switch state map was inverted: at idle all six read pressed, and the held button read released, so function switches acted on release. V15 now uses V12's debounced six-position/function switch code, which reads idle as released and acts on press.

Testing

  • On V15 hardware (2.12 build): tilt axes and directions are correct, function switches act on press, the diagnostics show released at idle, and S3 is gone.
  • Locally on main: V15 firmware, commit-tests.sh (v15), generate-yaml.sh (no diff), and gtests-companion.

🤖 Generated with Claude Code

pfeerick and others added 2 commits October 9, 2026 00:54
The IMU is mounted upside down and rotated, so TltX followed the Y tilt
and TltY the X tilt, both reversed. Swap X/Y in the board's IMU read
(before the generic inversion and calibration, so the X/Y settings stay
attached to the right source). Both axes are already inverted by
default via imu_invert_x/y.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The six function switch buttons are a resistor ladder on PC5, read by
sixPosUpdateFromAdc(). V15 exposed that input as P3, a FLEX pot with a
MULTIPOS default, so a meaningless S3 showed up in sources and
calibration. Its switch state map was also inverted: idle read as all
six pressed and the held button as released, so function switches
acted on release.

Declare the input as RAW1 (as V12 does) and use V12's debounced
six-position/function switch code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick pfeerick added this to the 3.0 milestone Oct 9, 2026
@pfeerick pfeerick added the bug 🪲 Something isn't working label Oct 9, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick
pfeerick marked this pull request as ready for review October 10, 2026 22:58
@pfeerick
pfeerick merged commit 1bc4a6f into main Oct 10, 2026
46 checks passed
@pfeerick
pfeerick deleted the pfeerick/v15-imu-fs-fix branch October 10, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant