1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-12-25 00:13:52 +00:00

Fixed 1st gen Xbox One controller not connecting

This commit is contained in:
cathery 2019-11-06 02:47:42 +03:00
parent a4ab68c40a
commit c89ff56482

View File

@ -46,24 +46,31 @@ Status XboxOneController::OpenInterfaces()
//TODO: check for numEndpoints before trying to open them! //TODO: check for numEndpoints before trying to open them!
if (interface->GetDescriptor()->bNumEndpoints >= 2) if (interface->GetDescriptor()->bNumEndpoints >= 2)
{ {
IUSBEndpoint *inEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_IN, 1); for (uint8_t i = 0; i != 15; ++i)
if (inEndpoint)
{ {
rc = inEndpoint->Open(); IUSBEndpoint *inEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_IN, i);
if (S_FAILED(rc)) if (inEndpoint)
return 5555; {
rc = inEndpoint->Open();
if (S_FAILED(rc))
return 5555;
m_inPipe = inEndpoint; m_inPipe = inEndpoint;
break;
}
} }
for (uint8_t i = 0; i != 15; ++i)
IUSBEndpoint *outEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_OUT, 1);
if (outEndpoint)
{ {
rc = outEndpoint->Open(); IUSBEndpoint *outEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_OUT, i);
if (S_FAILED(rc)) if (outEndpoint)
return 6666; {
rc = outEndpoint->Open();
if (S_FAILED(rc))
return 6666;
m_outPipe = outEndpoint; m_outPipe = outEndpoint;
break;
}
} }
} }
} }