Newer Xbox One controllers requires a longer initialisation command

Fixes #216
This commit is contained in:
Kristian Sloth Lauszus 2017-06-15 12:03:02 +02:00
parent ff8bdb24c1
commit f286114ac9
2 changed files with 7 additions and 3 deletions

View file

@ -179,7 +179,10 @@ uint8_t XBOXONE::Init(uint8_t parent, uint8_t port, bool lowspeed) {
// initialize the controller for input // initialize the controller for input
writeBuf[0] = 0x05; writeBuf[0] = 0x05;
writeBuf[1] = 0x20; writeBuf[1] = 0x20;
rcode = XboxCommand(writeBuf, 2); writeBuf[2] = 0x00;
writeBuf[3] = 0x01;
writeBuf[4] = 0x00;
rcode = XboxCommand(writeBuf, 5);
if (rcode) if (rcode)
goto Fail; goto Fail;

View file

@ -36,7 +36,8 @@
// PID and VID of the different devices // PID and VID of the different devices
#define XBOX_VID 0x045E // Microsoft Corporation #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 #define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer
@ -94,7 +95,7 @@ public:
* @return Returns true if the device's VID and PID matches this driver. * @return Returns true if the device's VID and PID matches this driver.
*/ */
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) { 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));
}; };
/**@}*/ /**@}*/