From d0b87fede62f2b16bd80eaa76f7ae7924330914a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 14 Jan 2021 23:49:27 -0800 Subject: [PATCH] Added HIDAPI rumble debug info --- src/joystick/hidapi/SDL_hidapi_rumble.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/joystick/hidapi/SDL_hidapi_rumble.c b/src/joystick/hidapi/SDL_hidapi_rumble.c index b5940a66b..869bef322 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);