mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Merge pull request #185 from felis/epAttribs
Don't set epAttribs to 0, as this will set bmNakPower to 0 as well. I…
This commit is contained in:
commit
ad966a5fb1
15 changed files with 44 additions and 24 deletions
3
BTD.cpp
3
BTD.cpp
|
@ -290,7 +290,8 @@ void BTD::Initialize() {
|
|||
for(i = 0; i < BTD_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
for(i = 0; i < BTD_NUM_SERVICES; i++) {
|
||||
|
|
|
@ -28,7 +28,8 @@ bPollEnable(false) // don't start polling before dongle is connected
|
|||
for(uint8_t i = 0; i < PS3_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
|
||||
|
|
3
Usb.cpp
3
Usb.cpp
|
@ -663,7 +663,8 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) {
|
|||
|
||||
epInfo.epAddr = 0;
|
||||
epInfo.maxPktSize = 8;
|
||||
epInfo.epAttribs = 0;
|
||||
epInfo.bmSndToggle = 0;
|
||||
epInfo.bmRcvToggle = 0;
|
||||
epInfo.bmNakPower = USB_NAK_MAX_POWER;
|
||||
|
||||
//delay(2000);
|
||||
|
|
|
@ -51,7 +51,8 @@ bPollEnable(false) { // don't start polling before dongle is connected
|
|||
for(uint8_t i = 0; i < XBOX_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ bPollEnable(false) { // don't start polling before dongle is connected
|
|||
for(uint8_t i = 0; i < XBOX_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ bPollEnable(false) { // don't start polling before dongle is connected
|
|||
for(uint8_t i = 0; i < XBOX_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ bPollEnable(false) { // don't start polling before dongle is connected
|
|||
for(uint8_t i = 0; i < XBOX_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,8 @@ public:
|
|||
thePool[0].epinfo = &dev0ep;
|
||||
dev0ep.epAddr = 0;
|
||||
dev0ep.maxPktSize = 8;
|
||||
dev0ep.epAttribs = 0; //set DATA0/1 toggles to 0
|
||||
dev0ep.bmSndToggle = 0; // Set DATA0/1 toggles to 0
|
||||
dev0ep.bmRcvToggle = 0;
|
||||
dev0ep.bmNakPower = USB_NAK_MAX_POWER;
|
||||
|
||||
InitAllAddresses();
|
||||
|
|
3
adk.cpp
3
adk.cpp
|
@ -45,7 +45,8 @@ ready(false) {
|
|||
for(uint8_t i = 0; i < ADK_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}//for(uint8_t i=0; i<ADK_MAX_ENDPOINTS; i++...
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ ready(false) {
|
|||
for(uint8_t i = 0; i < ACM_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i == epDataInIndex) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
|
||||
}
|
||||
|
@ -247,7 +248,8 @@ void ACM::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto
|
|||
// Fill in the endpoint info structure
|
||||
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||
epInfo[index].epAttribs = 0;
|
||||
epInfo[index].bmSndToggle = 0;
|
||||
epInfo[index].bmRcvToggle = 0;
|
||||
|
||||
bNumEP++;
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ wFTDIType(0) {
|
|||
for(uint8_t i = 0; i < FTDI_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i==epDataInIndex) ? USB_NAK_NOWAIT: USB_NAK_MAX_POWER;
|
||||
}
|
||||
if(pUsb)
|
||||
|
@ -227,7 +228,8 @@ void FTDI::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t prot
|
|||
// Fill in the endpoint info structure
|
||||
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||
epInfo[index].epAttribs = 0;
|
||||
epInfo[index].bmSndToggle = 0;
|
||||
epInfo[index].bmRcvToggle = 0;
|
||||
|
||||
bNumEP++;
|
||||
|
||||
|
|
|
@ -270,7 +270,8 @@ void HIDBoot<BOOT_PROTOCOL>::Initialize() {
|
|||
for(int i = 0; i < totalEndpoints(BOOT_PROTOCOL); i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
bNumEP = 1;
|
||||
|
@ -546,7 +547,8 @@ void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t
|
|||
// Fill in the endpoint info structure
|
||||
epInfo[bNumEP].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||
epInfo[bNumEP].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||
epInfo[bNumEP].epAttribs = 0;
|
||||
epInfo[bNumEP].bmSndToggle = 0;
|
||||
epInfo[bNumEP].bmRcvToggle = 0;
|
||||
epInfo[bNumEP].bmNakPower = USB_NAK_NOWAIT;
|
||||
bNumEP++;
|
||||
|
||||
|
|
|
@ -59,7 +59,8 @@ void HIDUniversal::Initialize() {
|
|||
for(uint8_t i = 0; i < totalEndpoints; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||
}
|
||||
bNumEP = 1;
|
||||
|
@ -323,7 +324,8 @@ void HIDUniversal::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint
|
|||
// Fill in the endpoint info structure
|
||||
epInfo[bNumEP].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||
epInfo[bNumEP].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||
epInfo[bNumEP].epAttribs = 0;
|
||||
epInfo[bNumEP].bmSndToggle = 0;
|
||||
epInfo[bNumEP].bmRcvToggle = 0;
|
||||
epInfo[bNumEP].bmNakPower = USB_NAK_NOWAIT;
|
||||
|
||||
// Fill in the endpoint index list
|
||||
|
|
|
@ -555,7 +555,8 @@ void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t
|
|||
// Fill in the endpoint info structure
|
||||
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||
epInfo[index].epAttribs = 0;
|
||||
epInfo[index].bmSndToggle = 0;
|
||||
epInfo[index].bmRcvToggle = 0;
|
||||
|
||||
bNumEP++;
|
||||
|
||||
|
@ -574,7 +575,8 @@ void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t
|
|||
// Fill in the endpoint info structure
|
||||
epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
|
||||
epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
|
||||
epInfo[index].epAttribs = 0;
|
||||
epInfo[index].bmSndToggle = 0;
|
||||
epInfo[index].bmRcvToggle = 0;
|
||||
|
||||
bNumEP++;
|
||||
|
||||
|
@ -850,7 +852,6 @@ uint8_t BulkOnly::ClearEpHalt(uint8_t index) {
|
|||
}
|
||||
epInfo[index].bmSndToggle = 0;
|
||||
epInfo[index].bmRcvToggle = 0;
|
||||
// epAttribs = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -890,8 +891,8 @@ void BulkOnly::ClearAllEP() {
|
|||
for(uint8_t i = 0; i < MASS_MAX_ENDPOINTS; i++) {
|
||||
epInfo[i].epAddr = 0;
|
||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||
epInfo[i].epAttribs = 0;
|
||||
|
||||
epInfo[i].bmSndToggle = 0;
|
||||
epInfo[i].bmRcvToggle = 0;
|
||||
epInfo[i].bmNakPower = USB_NAK_DEFAULT;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,12 +27,14 @@ qNextPollTime(0),
|
|||
bPollEnable(false) {
|
||||
epInfo[0].epAddr = 0;
|
||||
epInfo[0].maxPktSize = 8;
|
||||
epInfo[0].epAttribs = 0;
|
||||
epInfo[0].bmSndToggle = 0;
|
||||
epInfo[0].bmRcvToggle = 0;
|
||||
epInfo[0].bmNakPower = USB_NAK_MAX_POWER;
|
||||
|
||||
epInfo[1].epAddr = 1;
|
||||
epInfo[1].maxPktSize = 8; //kludge
|
||||
epInfo[1].epAttribs = 0;
|
||||
epInfo[1].bmSndToggle = 0;
|
||||
epInfo[1].bmRcvToggle = 0;
|
||||
epInfo[1].bmNakPower = USB_NAK_NOWAIT;
|
||||
|
||||
if(pUsb)
|
||||
|
|
Loading…
Reference in a new issue