From 731e1d8d152307cdefdb30005a35395a109e53a7 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Mon, 16 Mar 2026 19:18:37 -0600 Subject: [PATCH] fix(firmware): correct SPI 0x6080 horizontal offsets to match bridge output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SPI horizontal offsets at 0x6080 tell the Switch what accelerometer values to expect when the controller is held in normal gaming position. The Switch uses this as a gravity reference for its sensor fusion. Old values (-688, 0, 4038) were from a real Pro Controller's physical IMU chip. Our bridge sends ~(0, 0, 4096) through the axis reversal pipeline. The 388-count mismatch on X (0.095G = 5.4° tilt error) caused the Switch's sensor fusion to continuously fight the gyro data, trying to correct toward the wrong reference orientation → camera swinging. New values (0, 0, 4096) match the bridge's output for a still controller after SDL axis reversal, matching the zeroed calibration origins at 0x6020. --- switch_pro_driver.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/switch_pro_driver.cpp b/switch_pro_driver.cpp index 7680e8f..7e835e3 100644 --- a/switch_pro_driver.cpp +++ b/switch_pro_driver.cpp @@ -143,7 +143,12 @@ static const uint8_t factory_config_data[0xEFF] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x50, 0xFD, 0x00, 0x00, 0xC6, 0x0F, + // Six-Axis horizontal offsets (SPI 0x6080): expected accel when held in + // gaming position. Must match the bridge's actual output for a still + // controller. Old values (-688,0,4038) were for a real Pro Controller's + // physical IMU; our bridge sends (~0,~0,~4096). The 388-count mismatch + // on X caused the Switch's sensor fusion to fight the gyro → camera swing. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // (0, 0, 4096) = 1G on Z 0x0F, 0x30, 0x61, 0xAE, 0x90, 0xD9, 0xD4, 0x14, 0x54, 0x41, 0x15, 0x54, 0xC7, 0x79, 0x9C, 0x33, 0x36, 0x63,