fix(switch_pro): bcdDevice is 0x0210; add max_power_ma / remote_wakeup identity constants - #801
Merged
Merged
Conversation
…p identity constants A real Pro Controller reports device release 2.10 (not 2.00), 500 mA bMaxPower and remote wakeup. Correct bcd_device and add the other two as constants so emulators have one source of truth; the example feeds all three into espp::UsbDevice::Config (bcd_device / max_power_ma / remote_wakeup, #796). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
3 tasks
|
✅Static analysis result - no issues found! ✅ |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The public API and example descriptor changes are not fully reflected in the Sphinx and example README documentation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Updates Switch Pro USB identity constants and configures the example with descriptor values matching a real Pro Controller.
Changes:
- Corrects
bcd_deviceto0x0210. - Adds 500 mA and remote-wakeup constants.
- Applies all descriptor values in the USB example and documents them in the component README.
| File | Description |
|---|---|
components/switch_pro/include/switch_pro.hpp |
Adds corrected descriptor identity constants. |
components/switch_pro/example/main/switch_pro_example.cpp |
Applies descriptor constants to UsbDevice::Config. |
components/switch_pro/README.md |
Documents the new constants. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…README and Sphinx page Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
espp::SwitchPro::bcd_devicesaid 0x0200, but a real Pro Controller reports bcdDevice 2.10 (0x0210). That is the value the ryhoh fork's hand-rolled descriptors used, the valueusb_device's docs cite, and what finger563/esp-usb-ble-hid#27 now sets by hand. This fixes the constant so downstream emulators can use it as the single source of truth, and adds the two other descriptor details a Switch compares against alongside it:bcd_device = 0x0210max_power_ma = 500(new)remote_wakeup = true(new)The
switch_proexample feeds all three intoespp::UsbDevice::Config(the fields from #796), and the README lists them.Behaviour change for anyone reading
SwitchPro::bcd_device: espp itself never used it before this PR, so only downstream code that copied the constant into its descriptors is affected, and it becomes correct.Test plan
components/switch_pro/examplebuilds (esp32s3, manager off)bcdDevice 2.10,MaxPower 500mA, remote wakeup🤖 Generated with Claude Code
https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU