Skip to content

Commit

Permalink
Newer Xbox One controllers requires a longer initialization command
Browse files Browse the repository at this point in the history
Fixes #216
  • Loading branch information
Lauszus committed Jun 15, 2017
1 parent ff8bdb2 commit a88758c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion XBOXONE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ uint8_t XBOXONE::Init(uint8_t parent, uint8_t port, bool lowspeed) {
// initialize the controller for input
writeBuf[0] = 0x05;
writeBuf[1] = 0x20;
rcode = XboxCommand(writeBuf, 2);
writeBuf[2] = 0x00;
writeBuf[3] = 0x01;
writeBuf[4] = 0x00;
rcode = XboxCommand(writeBuf, 5);
if (rcode)
goto Fail;

Expand Down
5 changes: 3 additions & 2 deletions XBOXONE.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

// PID and VID of the different devices
#define XBOX_VID 0x045E // Microsoft Corporation
#define XBOX_ONE_PID 0x02D1 // Microsoft One Wired controller
#define XBOX_ONE_PID1 0x02D1 // Microsoft One Wired controller
#define XBOX_ONE_PID2 0x02DD // Microsoft One Wired controller

#define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer

Expand Down Expand Up @@ -94,7 +95,7 @@ class XBOXONE : public USBDeviceConfig {
* @return Returns true if the device's VID and PID matches this driver.
*/
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
return (vid == XBOX_VID && pid == XBOX_ONE_PID);
return (vid == XBOX_VID && (pid == XBOX_ONE_PID1 || pid == XBOX_ONE_PID2));
};
/**@}*/

Expand Down

0 comments on commit a88758c

Please sign in to comment.