Commit 65ff00ec1b1c45b9a95f495f107154c8eb5337bf

Sam Lantinga 2021-07-29T14:18:54

Query the rate for the correct sensor (thanks @meyraud705)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index a413df9..2a88745 100644
--- a/test/testgamecontroller.c
+++ b/test/testgamecontroller.c
@@ -163,7 +163,7 @@ static void AddController(int device_index, SDL_bool verbose)
 
     if (SDL_GameControllerHasSensor(gamecontroller, SDL_SENSOR_GYRO)) {
         if (verbose) {
-            SDL_Log("Enabling gyro at %.2f Hz\n", SDL_GameControllerGetSensorDataRate(gamecontroller, SDL_SENSOR_ACCEL));
+            SDL_Log("Enabling gyro at %.2f Hz\n", SDL_GameControllerGetSensorDataRate(gamecontroller, SDL_SENSOR_GYRO));
         }
         SDL_GameControllerSetSensorEnabled(gamecontroller, SDL_SENSOR_GYRO, SDL_TRUE);
     }