Commit graph

93 commits

Author SHA1 Message Date
db4a860cd6 Fix Windows adapter enumeration and rumble 2026-09-02 12:29:57 -06:00
a7fb6c5694 Add Windows XInput feasibility test 2026-09-02 09:08:49 -06:00
604450375d Merge branch 'master' into feasibility/adapter-parity 2026-09-02 08:57:52 -06:00
8351cb1d15 Enable strong rumble for 8BitDo Switch mode 2026-09-02 08:50:26 -06:00
7e3be8675f Verify automatic XInput mode switching 2026-09-02 08:20:14 -06:00
17b3d7399c Prototype adapter XInput feasibility 2026-09-02 07:53:18 -06:00
fd23842327 Preserve and reconnect 8BitDo controllers 2026-09-01 08:58:16 -06:00
41c7021813 Add physical and USB pairing management 2026-09-01 08:19:11 -06:00
74a62f035b Gate new controller pairing behind BOOTSEL 2026-09-01 07:49:03 -06:00
146c377311 Allow controller reconnect without BOOTSEL 2026-09-01 07:38:21 -06:00
81f6ac1236 Add per-controller motion toggle 2026-08-31 22:30:29 -06:00
94ccfc7220 Implement per-controller ABXY toggle 2026-08-31 22:17:37 -06:00
fa8ccf0b12 Refresh normalized AIO firmware 2026-08-31 13:57:30 -06:00
11eb44d3d1 Normalize Wii and PS Move motion 2026-08-31 12:12:44 -06:00
d9f0761949 Align AIO release documentation 2026-08-31 09:15:28 -06:00
23a3cbade5 Assign colors per controller slot 2026-08-31 09:06:00 -06:00
4a73680bd2 Gate controller pairing behind BOOTSEL 2026-08-31 08:25:08 -06:00
fac919a798 Scale AIO transport to four controllers 2026-08-30 23:23:29 -06:00
18c27b06ae Verify and publish dual-controller AIO firmware 2026-08-30 22:40:03 -06:00
edf6ecaae1 Add dual-controller AIO USB transport 2026-08-30 20:54:59 -06:00
7941294a8d Isolate Switch Pro state by HID instance 2026-08-30 20:35:23 -06:00
04df6b88ad Remove rumble activity from Pico status LED 2026-08-30 16:30:10 -06:00
7bd3244006 Add Pico 2 W Bluetooth status diagnostics
Expose scanning, connecting, ready, and nonzero rumble activity on the onboard LED; publish the physically verified AIO firmware.
2026-08-30 16:21:24 -06:00
bce94d38ce Add stateful HD-rumble decoder with TinyUSB report normalization
Decode Nintendo HD-rumble words once in firmware into conventional low/high magnitudes and normalize stripped control SET_REPORT vs complete interrupt OUT reports through one path.
2026-08-29 22:19:31 -06:00
20c9c98f89 Document and publish Bluepad32 AIO firmware 2026-08-29 17:46:54 -06:00
f451e27f8c Add Pico 2 W Bluepad32 AIO backend 2026-08-29 17:37:48 -06:00
287ef24fef Update README for SDL3 2026-08-29 13:52:27 -06:00
9d627214fb Publish firmware artifacts after build 2026-08-29 13:39:44 -06:00
72a814159a Document Switch IMU mode implementation 2026-08-29 13:37:02 -06:00
6b6504cf67 Fix Switch quaternion IMU mode 2026-08-29 13:35:24 -06:00
9855583019 Update firmware 2026-08-14 21:39:11 +09:00
76c1f7c2d2 Update uv lock 2026-08-14 21:37:24 +09:00
9ef5cb3813 Update to build uf2 and elf with build.py 2026-08-14 21:36:57 +09:00
0f037b0a44 feat(bridge): add controller-side ABXY swap combo (LB+RB+SELECT+START)
Holding all four buttons simultaneously toggles the ABXY layout for that controller with a 200ms rumble confirmation pulse.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 20:43:32 -06:00
311bec8f0d feat(bridge): migrate to SDL3 and fix controller hotplug issues
- Migrate all SDL2 GameController API calls to SDL3 Gamepad equivalents
- Fix PermissionError on controller reconnect by closing UART handle before
  releasing port back to pool (Windows holds COM ports exclusively)
- Add DisplayIndexAllocator so controllers get stable display indices (0, 0, 0)
  instead of incrementing SDL instance IDs (1, 2, 3) on each reconnect
- Button mapping now uses SDL3 positional constants (SOUTH/EAST/WEST/NORTH)
  which works correctly for all controller types without USE_BUTTON_LABELS hint

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 16:54:58 -06:00
3178a1ca97 chore: replace pysdl2 with PySDL3 for SDL3 sensor support
SDL3 includes a dedicated 8BitDo HIDAPI driver with native gyro/accel sensor support, which SDL2 lacked.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-16 16:54:45 -06:00
1f016a0848 chore: add uv lockfile for reproducible dependency resolution 2026-03-16 12:19:36 -06:00
424c8feb57 chore: update README with IMU/motion controls documentation 2026-03-16 12:00:49 -06:00
a55b3786c1 fix(bridge): reverse SDL axis remapping to recover Nintendo-native IMU axes
SDL's hidapi_switch.c SendSensorUpdate() remaps Nintendo's raw sensor axes
to match PlayStation convention before emitting SDL sensor events:
  SDL_X = -Nintendo_Y, SDL_Y = +Nintendo_Z, SDL_Z = -Nintendo_X

This commit reverses that transform so the values sent to the Pico are in
Nintendo's native coordinate frame:
  Nintendo_X_raw = -SDL_Z
  Nintendo_Y_raw = -SDL_X
  Nintendo_Z_raw = +SDL_Y

Same mapping for gyro (bias subtraction happens before axis reversal).
Confirmed from SDL3 hidapi_switch.c source (SDL2 uses same SDL3 backend).
2026-03-16 12:00:44 -06:00
65af2f6d5f chore: add IMU diagnostic tool
- Add tools/read_pro_imu.py from gyrov3 branch
- Reads raw 0x30 HID reports from Switch Pro Controller / Pico
- Lazy pyhidapi import with helpful error message when missing
- Supports --list, --count, --plot, --save-prefix flags
2026-03-16 11:50:46 -06:00
eb8994ec3b feat(bridge): add SDL sensor reading and gyro bias calibration
- Add initialize_controller_sensors() for SDL accel/gyro enable
- Add handle_sensor_update() with direct axis passthrough (no remapping)
- Add gyro bias calibration (200 samples, zero gyro until locked)
- Add IMU sample FIFO with pop-to-report before UART send
- Add --debug-imu, --no-imu, --gyro-scale CLI flags
2026-03-16 11:50:40 -06:00
4501528371 feat(firmware): add IMU data structures and UART v2 parser
- Add SwitchImuSample struct and IMU fields to SwitchInputState
- Add fill_imu_report_data() to pack samples into imuData[36]
- Rewrite switch_pro_apply_uart_packet() for v2 with checksum validation
- Enlarge poll_uart_frames() buffer to 64 bytes for variable-length frames
- Clear imu_sample_count after each USB report send (prevent stale IMU)
2026-03-16 11:50:32 -06:00
fa0ddcd10f feat(uart): add v2 protocol with IMU sample support
- Add UART_PROTOCOL_VERSION=2, IMUSample dataclass, conversion constants
- Rewrite SwitchReport.to_bytes() for versioned v2 framing with checksum
- Add ACCEL_LSB_PER_G=4096, GYRO_LSB_PER_RAD_S=818.5, MS2_PER_G constants
- Add SENSOR_ACCEL/SENSOR_GYRO SDL type constants with fallback
- Add protocol round-trip tests (8 tests, all passing)
2026-03-16 11:50:25 -06:00
1a1d6db3df Fix controllers 2026-01-10 23:19:32 -07:00
62707e419b Add license 2025-12-14 14:47:49 -07:00
c00b096209 Add references 2025-12-14 14:08:03 -07:00
6f8c698805 Add gyro branch ref 2025-12-14 14:04:28 -07:00
e549376ee4 Touch up readme, fix build.py 2025-12-14 13:31:11 -07:00
06d702d91d Add firmware and readme for building firmware 2025-12-14 13:23:20 -07:00
231a38cb64 Update readme 2025-12-14 13:10:39 -07:00