Skip to content

Commit

Permalink
Enable the LED on PowerA Xbox One controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 14, 2019
1 parent 511df4a commit c2b6d6f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/joystick/hidapi/SDL_hidapi_xboxone.c
Expand Up @@ -73,6 +73,13 @@ static const Uint8 xboxone_fw2015_init[] = {
0x05, 0x20, 0x00, 0x01, 0x00
};

/*
* This packet turns on the LED on some controllers, including PowerA
*/
static const Uint8 xboxone_led_enable[] = {
0x0A, 0x20, 0x04, 0x03, 0x00, 0x01, 0x14
};

/*
* This packet is required for the Titanfall 2 Xbox One pads
* (0x0e6f:0x0165) to finish initialization and for Hori pads
Expand Down Expand Up @@ -145,14 +152,11 @@ static const SDL_DriverXboxOne_InitPacket xboxone_init_packets[] = {
{ 0x045e, 0x0b00, xboxone_elite_init4, sizeof(xboxone_elite_init4) },
{ 0x045e, 0x0b00, xboxone_elite_init5, sizeof(xboxone_elite_init5) },
{ 0x0000, 0x0000, xboxone_fw2015_init, sizeof(xboxone_fw2015_init) },
{ 0x0000, 0x0000, xboxone_led_enable, sizeof(xboxone_led_enable) },
{ 0x0e6f, 0x0000, xboxone_pdp_init1, sizeof(xboxone_pdp_init1) },
{ 0x0e6f, 0x0000, xboxone_pdp_init2, sizeof(xboxone_pdp_init2) },
{ 0x24c6, 0x541a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
{ 0x24c6, 0x542a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
{ 0x24c6, 0x543a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
{ 0x24c6, 0x541a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
{ 0x24c6, 0x542a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
{ 0x24c6, 0x543a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
{ 0x24c6, 0x0000, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
{ 0x24c6, 0x0000, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
};

typedef struct {
Expand Down

0 comments on commit c2b6d6f

Please sign in to comment.