[PR #308] [MERGED] Enable raw IMU in every emulated gyro mode without reconnection #276

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

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/308
Author: @FakeGiraffe93
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @safijari

Base: main ← Head: fix/gyro-all-modes


📝 Commits (1)

  • f4c170e Enable raw IMU in every emulated gyro mode

📊 Changes

1 file changed (+41 additions, -13 deletions)

View changed files

📝 OpenPuck/haptics.cpp (+41 -13)

📄 Description

Problem

Gyro reported nothing in every emulated mode (Switch Pro, DS5, DS4, SInput), while Steam (puck) mode worked fine.

Steam can leave the controller's persisted IMU_MODE off, which suppresses the RF motion samples. #249 re-enabled it, but only for MODE_SW_PRO and only from hapticOnReconnect. So:

  • DS5 / DS4 / PS3 / DirectInput / SInput never turned the IMU back on.
  • Switching into Switch Pro with the controller already connected (back-4 + Y, or the WebUSB panel) keeps the RF link up, so hapticOnReconnect never fires and the IMU stays off.

Fix (OpenPuck/haptics.cpp)

  • modeWantsImu() lists every mode that reports motion: SW_PRO, DS5, DS4, SINPUT.
  • imuForceRaw(slot) writes IMU_MODE = raw accel | raw gyro when the active mode wants motion. It replaces the Switch-Pro-only block in hapticOnReconnect.
  • hapticTask() sends the same write to each connected slot on a mode change, and every 5 s as a keepalive in case something turns it back off mid-session.

Puck/Steam mode is unaffected, because Steam still owns IMU_MODE there.

Testing

On CachyOS Linux with Steam's gyro calibration screen and Eden's controller settings, gyro works again in:

  • DS5 mode
  • DS4 mode
  • SInput mode (steam calibration only, eden doesnt detect gyro)
  • switch pro mode (steam calibration only, eden doesnt detect any inputs, but sees controller. same issue on clean fw)

Formatted with clang-format. CI pins v18; I used v23 locally, but the result matches the file's existing style.

🤖 Generated with Claude Code, proof read and edited by myself a human. i dont know how to code but i know enough to read.


🔄 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/308 **Author:** [@FakeGiraffe93](https://github.com/FakeGiraffe93) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `fix/gyro-all-modes` --- ### 📝 Commits (1) - [`f4c170e`](https://github.com/safijari/openpuck/commit/f4c170e15eb0bf6031003afa8e20b5d7bdc7f8e2) Enable raw IMU in every emulated gyro mode ### 📊 Changes **1 file changed** (+41 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/haptics.cpp` (+41 -13) </details> ### 📄 Description ## Problem Gyro reported nothing in every emulated mode (Switch Pro, DS5, DS4, SInput), while Steam (puck) mode worked fine. Steam can leave the controller's persisted `IMU_MODE` off, which suppresses the RF motion samples. #249 re-enabled it, but only for `MODE_SW_PRO` and only from `hapticOnReconnect`. So: - DS5 / DS4 / PS3 / DirectInput / SInput never turned the IMU back on. - Switching into Switch Pro with the controller already connected (back-4 + Y, or the WebUSB panel) keeps the RF link up, so `hapticOnReconnect` never fires and the IMU stays off. ## Fix (`OpenPuck/haptics.cpp`) - `modeWantsImu()` lists every mode that reports motion: SW_PRO, DS5, DS4, SINPUT. - `imuForceRaw(slot)` writes `IMU_MODE = raw accel | raw gyro` when the active mode wants motion. It replaces the Switch-Pro-only block in `hapticOnReconnect`. - `hapticTask()` sends the same write to each connected slot on a mode change, and every 5 s as a keepalive in case something turns it back off mid-session. Puck/Steam mode is unaffected, because Steam still owns `IMU_MODE` there. ## Testing On CachyOS Linux with Steam's gyro calibration screen and Eden's controller settings, gyro works again in: - DS5 mode - DS4 mode - SInput mode (steam calibration only, eden doesnt detect gyro) - switch pro mode (steam calibration only, eden doesnt detect any inputs, but sees controller. same issue on clean fw) Formatted with clang-format. CI pins v18; I used v23 locally, but the result matches the file's existing style. 🤖 Generated with [Claude Code](https://claude.com/claude-code), proof read and edited by myself a human. i dont know how to code but i know enough to read. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:08:37 +00:00
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#276
No description provided.