fixed Get Conf Descr and delay after SetAddr in hiduniversal

This commit is contained in:
Oleg Mazurov 2013-09-10 16:10:34 -06:00
parent bab7d2a9c4
commit 9e1ea2ac1b
2 changed files with 5 additions and 1 deletions

View file

@ -751,11 +751,13 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t con
return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, NULL)); return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, NULL));
} }
/* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this
total length. The length of the first request can be shorter ( 4 bytes ), however, there are devices which won't work unless this length is set to 9 */
uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) { uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) {
const uint8_t bufSize = 64; const uint8_t bufSize = 64;
uint8_t buf[bufSize]; uint8_t buf[bufSize];
uint8_t ret = getConfDescr(addr, ep, 8, conf, buf); uint8_t ret = getConfDescr(addr, ep, 9, conf, buf);
if (ret) if (ret)
return ret; return ret;

View file

@ -147,6 +147,8 @@ uint8_t HIDUniversal::Init(uint8_t parent, uint8_t port, bool lowspeed) {
return rcode; return rcode;
} }
delay( 2 ); //per USB 2.0 sect.9.2.6.3
USBTRACE2("Addr:", bAddress); USBTRACE2("Addr:", bAddress);
p->lowspeed = false; p->lowspeed = false;