From fbd7c718b67f01e36a14e2236517091d0ee5d6b2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 13 Jan 2021 11:02:07 -0800 Subject: [PATCH] Don't blink the Xbox 360 LED when setting the player slot, it's probably already been set by a driver --- src/joystick/hidapi/SDL_hidapi_xbox360.c | 3 ++- src/joystick/hidapi/SDL_hidapi_xbox360w.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c index 7a12258a8..51e7e7a99 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c @@ -106,7 +106,8 @@ HIDAPI_DriverXbox360_GetDeviceName(Uint16 vendor_id, Uint16 product_id) static SDL_bool SetSlotLED(hid_device *dev, Uint8 slot) { - Uint8 mode = 0x02 + slot; + const SDL_bool blink = SDL_FALSE; + Uint8 mode = (blink ? 0x02 : 0x06) + slot; const Uint8 led_packet[] = { 0x01, 0x03, mode }; if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) { diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360w.c b/src/joystick/hidapi/SDL_hidapi_xbox360w.c index df0c2fdf9..7438ea583 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360w.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360w.c @@ -64,7 +64,8 @@ HIDAPI_DriverXbox360W_GetDeviceName(Uint16 vendor_id, Uint16 product_id) static SDL_bool SetSlotLED(hid_device *dev, Uint8 slot) { - Uint8 mode = 0x02 + slot; + const SDL_bool blink = SDL_FALSE; + Uint8 mode = (blink ? 0x02 : 0x06) + slot; const Uint8 led_packet[] = { 0x00, 0x00, 0x08, (0x40 + (mode % 0x0e)), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) {