Enable the LED on PowerA Xbox One controllers
authorSam Lantinga <slouken@libsdl.org>
Fri, 13 Dec 2019 16:12:37 -0800
changeset 133440532eba8e423
parent 13343 bf120d8c7ff7
child 13345 09dad61c953c
Enable the LED on PowerA Xbox One controllers
src/joystick/hidapi/SDL_hidapi_xboxone.c
     1.1 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c	Fri Dec 13 16:12:35 2019 -0800
     1.2 +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c	Fri Dec 13 16:12:37 2019 -0800
     1.3 @@ -74,6 +74,13 @@
     1.4  };
     1.5  
     1.6  /*
     1.7 + * This packet turns on the LED on some controllers, including PowerA
     1.8 + */
     1.9 +static const Uint8 xboxone_led_enable[] = {
    1.10 +    0x0A, 0x20, 0x04, 0x03, 0x00, 0x01, 0x14
    1.11 +};
    1.12 +
    1.13 +/*
    1.14   * This packet is required for the Titanfall 2 Xbox One pads
    1.15   * (0x0e6f:0x0165) to finish initialization and for Hori pads
    1.16   * (0x0f0d:0x0067) to make the analog sticks work.
    1.17 @@ -145,14 +152,11 @@
    1.18      { 0x045e, 0x0b00, xboxone_elite_init4, sizeof(xboxone_elite_init4) },
    1.19      { 0x045e, 0x0b00, xboxone_elite_init5, sizeof(xboxone_elite_init5) },
    1.20      { 0x0000, 0x0000, xboxone_fw2015_init, sizeof(xboxone_fw2015_init) },
    1.21 +    { 0x0000, 0x0000, xboxone_led_enable, sizeof(xboxone_led_enable) },
    1.22      { 0x0e6f, 0x0000, xboxone_pdp_init1, sizeof(xboxone_pdp_init1) },
    1.23      { 0x0e6f, 0x0000, xboxone_pdp_init2, sizeof(xboxone_pdp_init2) },
    1.24 -    { 0x24c6, 0x541a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
    1.25 -    { 0x24c6, 0x542a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
    1.26 -    { 0x24c6, 0x543a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
    1.27 -    { 0x24c6, 0x541a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
    1.28 -    { 0x24c6, 0x542a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
    1.29 -    { 0x24c6, 0x543a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
    1.30 +    { 0x24c6, 0x0000, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
    1.31 +    { 0x24c6, 0x0000, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
    1.32  };
    1.33  
    1.34  typedef struct {