Commit graph

9 commits

Author SHA1 Message Date
30e22c210c
fix(firmware): zero SPI IMU calibration origins to prevent phantom rotation
The Switch applies its stored SPI calibration when interpreting IMU data:
  gyro_dps = (raw - spi_origin) * 936 / coeff

The firmware had real hardware offsets as calibration origins:
  gyro_origin = (9, -22, -95)  accel_origin = (-29, -199, 493)

A real Pro Controller sensor reads those values at rest, so the Switch
subtracts them to get zero. But our bridge already removes hardware bias
via gyro bias calibration and sends near-zero counts when still.

The Switch was then applying a second origin correction:
  gyro_z=2 → (2 - (-95)) * 0.070 = 6.79 dps constant yaw rotation

This caused the character to spin horizontally even when holding the
controller perfectly still.

Fix: zero all calibration origins. The bridge handles bias correction;
the Switch must not apply a second offset on top.
2026-03-16 17:22:52 -06:00
0db04be858
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
02bce399a5
Add color config 2025-11-21 13:23:43 -07:00
de4c978a07
WORKING 2025-11-20 22:40:36 -07:00
b07801e11f
WIP No debug 2 2025-11-20 18:03:06 -07:00
a6ad93d184
WIP No debug 2025-11-20 18:02:54 -07:00
e7224c13d2
Remove debug logging if flag is present 2025-11-20 17:39:53 -07:00
2225e70e5e
It's connecting!! 2025-11-20 17:18:03 -07:00
bb5e51330a
Initial commit 2025-11-20 11:20:19 -07:00