Allow 1 kHz sample rate for DualSense Edge over USB

DualSense Edge natively reports at 1 kHz for all connection types, but gyro sample rate was limited to 250 Hz for USB.

(cherry picked from commit a07cf3ecdc)
This commit is contained in:
Andon M. Coleman authored and Sam Lantinga committed 2025-07-14 10:02:46 -07:00
1 parent 0d01efca52
commit 68bfcb6c54
1 file changed
+10 -5
+10 -5
View File
@@ -812,14 +812,19 @@ static void HIDAPI_DriverPS5_SetEnhancedModeAvailable(SDL_DriverPS5_Context *ctx
} }
if (ctx->sensors_supported) { if (ctx->sensors_supported) {
// Standard DualSense sensor update rate is 250 Hz over USB
float update_rate = 250.0f;
if (ctx->device->is_bluetooth) { if (ctx->device->is_bluetooth) {
// Bluetooth sensor update rate appears to be 1000 Hz // Bluetooth sensor update rate appears to be 1000 Hz
SDL_PrivateJoystickAddSensor(ctx->joystick, SDL_SENSOR_GYRO, 1000.0f); update_rate = 1000.0f;
SDL_PrivateJoystickAddSensor(ctx->joystick, SDL_SENSOR_ACCEL, 1000.0f); } else if (SDL_IsJoystickDualSenseEdge(ctx->device->vendor_id, ctx->device->product_id)) {
} else { // DualSense Edge sensor update rate is 1000 Hz over USB
SDL_PrivateJoystickAddSensor(ctx->joystick, SDL_SENSOR_GYRO, 250.0f); update_rate = 1000.0f;
SDL_PrivateJoystickAddSensor(ctx->joystick, SDL_SENSOR_ACCEL, 250.0f);
} }
SDL_PrivateJoystickAddSensor(ctx->joystick, SDL_SENSOR_GYRO, update_rate);
SDL_PrivateJoystickAddSensor(ctx->joystick, SDL_SENSOR_ACCEL, update_rate);
} }
ctx->report_battery = true; ctx->report_battery = true;