mirror of https://github.com/encounter/SDL.git
Don't blink the Xbox 360 LED when setting the player slot, it's probably already been set by a driver
This commit is contained in:
parent
d757ec7f5c
commit
fbd7c718b6
|
@ -106,7 +106,8 @@ HIDAPI_DriverXbox360_GetDeviceName(Uint16 vendor_id, Uint16 product_id)
|
||||||
|
|
||||||
static SDL_bool SetSlotLED(hid_device *dev, Uint8 slot)
|
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 };
|
const Uint8 led_packet[] = { 0x01, 0x03, mode };
|
||||||
|
|
||||||
if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) {
|
if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) {
|
||||||
|
|
|
@ -64,7 +64,8 @@ HIDAPI_DriverXbox360W_GetDeviceName(Uint16 vendor_id, Uint16 product_id)
|
||||||
|
|
||||||
static SDL_bool SetSlotLED(hid_device *dev, Uint8 slot)
|
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 };
|
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)) {
|
if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) {
|
||||||
|
|
Loading…
Reference in New Issue