mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Check bmAttributes when extracting endpoint structure
This commit is contained in:
parent
0be721e1b3
commit
39e28822ba
1 changed files with 11 additions and 14 deletions
11
adk.cpp
11
adk.cpp
|
@ -299,7 +299,7 @@ Fail:
|
||||||
/* Extracts bulk-IN and bulk-OUT endpoint information from config descriptor */
|
/* Extracts bulk-IN and bulk-OUT endpoint information from config descriptor */
|
||||||
void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
|
void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
|
||||||
//ErrorMessage<uint8_t>(PSTR("Conf.Val"), conf);
|
//ErrorMessage<uint8_t>(PSTR("Conf.Val"), conf);
|
||||||
//ErrorMessage<uint8_t>(PSTR("Iface Num"),iface);
|
//ErrorMessage<uint8_t>(PSTR("Iface Num"), iface);
|
||||||
//ErrorMessage<uint8_t>(PSTR("Alt.Set"), alt);
|
//ErrorMessage<uint8_t>(PSTR("Alt.Set"), alt);
|
||||||
|
|
||||||
//added by Yuuichi Akagawa
|
//added by Yuuichi Akagawa
|
||||||
|
@ -309,12 +309,8 @@ void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto
|
||||||
|
|
||||||
bConfNum = conf;
|
bConfNum = conf;
|
||||||
|
|
||||||
uint8_t index;
|
if ((pep->bmAttributes & 0x02) == 2) {
|
||||||
|
uint8_t index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
|
||||||
// if ((pep->bmAttributes & 0x02) == 2) {
|
|
||||||
index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Fill in the endpoint info structure
|
// Fill in the endpoint info structure
|
||||||
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
|
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||||
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||||
|
@ -322,6 +318,7 @@ void ADK::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto
|
||||||
bNumEP++;
|
bNumEP++;
|
||||||
|
|
||||||
//PrintEndpointDescriptor(pep);
|
//PrintEndpointDescriptor(pep);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Performs a cleanup after failed Init() attempt */
|
/* Performs a cleanup after failed Init() attempt */
|
||||||
|
|
Loading…
Reference in a new issue