Restart the IMU if the controller stops sending gyro/accel data

This commit is contained in:
Sam Lantinga
2022-08-08 20:09:49 -07:00
parent 56c1481cab
commit 6204ae5002
2 changed files with 23 additions and 6 deletions

View File

@@ -2897,6 +2897,7 @@ int SDL_PrivateJoystickSensor(SDL_Joystick *joystick, SDL_SensorType type, const
/* Update internal sensor state */
SDL_memcpy(sensor->data, data, num_values*sizeof(*data));
SDL_Log("Sensor %d data: %.2f,%.2f,%.2f\n", sensor->type, data[0], data[1], data[2]);
/* Post the event, if desired */
#if !SDL_EVENTS_DISABLED