Check bmAttributes when extracting endpoint structure

This commit is contained in:
Kristian Sloth Lauszus 2013-10-30 15:20:07 +01:00
parent 0be721e1b3
commit 39e28822ba

View file

@ -309,12 +309,8 @@ void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto
bConfNum = conf;
uint8_t index;
// if ((pep->bmAttributes & 0x02) == 2) {
index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
// }
if ((pep->bmAttributes & 0x02) == 2) {
uint8_t index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
// Fill in the endpoint info structure
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
@ -323,6 +319,7 @@ void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto
//PrintEndpointDescriptor(pep);
}
}
/* Performs a cleanup after failed Init() attempt */
uint8_t ADK::Release() {