Commit d0b87fede62f2b16bd80eaa76f7ae7924330914a

Sam Lantinga 2021-01-14T23:49:27

Added HIDAPI rumble debug info

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/joystick/hidapi/SDL_hidapi_rumble.c b/src/joystick/hidapi/SDL_hidapi_rumble.c
index b5940a6..869bef3 100644
--- a/src/joystick/hidapi/SDL_hidapi_rumble.c
+++ b/src/joystick/hidapi/SDL_hidapi_rumble.c
@@ -77,7 +77,10 @@ static int SDL_HIDAPI_RumbleThread(void *data)
         if (request) {
             SDL_LockMutex(request->device->dev_lock);
             if (request->device->dev) {
-                hid_write( request->device->dev, request->data, request->size );
+#ifdef DEBUG_RUMBLE
+                HIDAPI_DumpPacket("Rumble packet: size = %d", request->data, request->size);
+#endif
+                hid_write(request->device->dev, request->data, request->size);
             }
             SDL_UnlockMutex(request->device->dev_lock);
             (void)SDL_AtomicDecRef(&request->device->rumble_pending);