[PR #86] [MERGED] feat: per-emulated-type LED brightness, persisted across mode switches #194

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

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/86
Author: @Copilot
Created: 6/25/2026
Status: ✅ Merged
Merged: 6/25/2026
Merged by: @safijari

Base: main ← Head: copilot/add-slider-for-controller-mode


📝 Commits (2)

  • a4d7919 feat: add per-type LED brightness slider, persist across mode switches (fixes #62)
  • 72f526e style: address code review comments on LED brightness change

📊 Changes

5 files changed (+57 additions, -25 deletions)

View changed files

📝 OpenPuck/config.cpp (+10 -7)
📝 OpenPuck/config.h (+6 -0)
📝 OpenPuck/haptics.cpp (+7 -0)
📝 OpenPuck/webusb_config.cpp (+15 -10)
📝 docs/index.html (+19 -8)

📄 Description

In emulated modes (Xbox, Switch, PS5, DS4) nobody sends the LED brightness command — Steam owns that in Steam mode but nothing does in emulated modes, so the controller always comes up at full brightness regardless of what you had set.

Changes

  • TypeCfg + flash — new uint8_t ledBright field (0 = no override / Auto, 1–100 = brightness %). CFG_MAGIC bumped 0xCA → 0xCB; old configs get clean defaults on first boot after upgrade.
  • hapticReinit — appends an 0x87 [0x2D][val][0x00] relay when g_ledBright > 0. This is the same register Steam uses, already whitelisted for type-01 framing so the command actually lands.
  • WebUSB blob v10 — payload 101 → 105 bytes; per-type section grows from 7 to 8 bytes. k=7 added to the SET handler (field = 40 + et*8 + 7, value clamped 0–100).
  • WebUI — LED brightness range slider in each controller-type tab. Shows "Auto" at 0, N% otherwise. Wired to setField(40+et*8+7, val) on change.

🔄 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/86 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 6/25/2026 **Status:** ✅ Merged **Merged:** 6/25/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `copilot/add-slider-for-controller-mode` --- ### 📝 Commits (2) - [`a4d7919`](https://github.com/safijari/openpuck/commit/a4d7919e04a97ba08d643790387ddb98a32d371e) feat: add per-type LED brightness slider, persist across mode switches (fixes #62) - [`72f526e`](https://github.com/safijari/openpuck/commit/72f526e9e9b2a9176288bd817c1fdd20e12b4f36) style: address code review comments on LED brightness change ### 📊 Changes **5 files changed** (+57 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/config.cpp` (+10 -7) 📝 `OpenPuck/config.h` (+6 -0) 📝 `OpenPuck/haptics.cpp` (+7 -0) 📝 `OpenPuck/webusb_config.cpp` (+15 -10) 📝 `docs/index.html` (+19 -8) </details> ### 📄 Description In emulated modes (Xbox, Switch, PS5, DS4) nobody sends the LED brightness command — Steam owns that in Steam mode but nothing does in emulated modes, so the controller always comes up at full brightness regardless of what you had set. ## Changes - **`TypeCfg` + flash** — new `uint8_t ledBright` field (0 = no override / Auto, 1–100 = brightness %). `CFG_MAGIC` bumped `0xCA → 0xCB`; old configs get clean defaults on first boot after upgrade. - **`hapticReinit`** — appends an `0x87 [0x2D][val][0x00]` relay when `g_ledBright > 0`. This is the same register Steam uses, already whitelisted for type-01 framing so the command actually lands. - **WebUSB blob v10** — payload 101 → 105 bytes; per-type section grows from 7 to 8 bytes. `k=7` added to the SET handler (`field = 40 + et*8 + 7`, value clamped 0–100). - **WebUI** — LED brightness range slider in each controller-type tab. Shows "Auto" at 0, `N%` otherwise. Wired to `setField(40+et*8+7, val)` on `change`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:07:23 +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#194
No description provided.