The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors (cherry picked from commit 558bbbb07ae0afa0108c1560915351cfa13442b7)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c
index f304e3e..dc7a0fa 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps4.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps4.c
@@ -603,40 +603,19 @@ static void HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device)
if (i < 3) {
scale *= ((double)ctx->gyro_numerator / ctx->gyro_denominator) * M_PI / 180.0;
- if (device->vendor_id == USB_VENDOR_SONY &&
- device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
- /* The Armor-X Pro seems to only deliver half the rotation it should,
- * and in the opposite direction on the Z axis */
- switch (i) {
- case 0:
- case 1:
- scale *= 2.0;
- break;
- case 2:
- scale *= -2.0;
- break;
- default:
- break;
- }
- }
+ if (device->vendor_id == USB_VENDOR_SONY &&
+ device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
+ /* The Armor-X Pro seems to only deliver half the rotation it should */
+ scale *= 2.0;
+ }
} else {
scale *= ((double)ctx->accel_numerator / ctx->accel_denominator) * SDL_STANDARD_GRAVITY;
if (device->vendor_id == USB_VENDOR_SONY &&
device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
/* The Armor-X Pro seems to only deliver half the acceleration it should,
- * and in the opposite direction on the X and Y axes */
- switch (i) {
- case 3:
- case 4:
- scale *= -2.0;
- break;
- case 5:
- scale *= 2.0;
- break;
- default:
- break;
- }
+ * and in the opposite direction on all axes */
+ scale *= -2.0;
}
}
ctx->calibration[i].scale = (float)scale;