mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Change to Windows style enumeration process.
Some devices return only 8 bytes of Device Descriptor by default address. (e.g. Novation Circuit)
This commit is contained in:
parent
86ac217305
commit
cf0fad4045
1 changed files with 10 additions and 4 deletions
|
@ -147,10 +147,9 @@ uint8_t USBH_MIDI::Init(uint8_t parent, uint8_t port, bool lowspeed)
|
|||
p->epinfo = epInfo;
|
||||
p->lowspeed = lowspeed;
|
||||
|
||||
// Get device descriptor
|
||||
rcode = pUsb->getDevDescr( 0, 0, sizeof(USB_DEVICE_DESCRIPTOR), (uint8_t*)buf );
|
||||
vid = udd->idVendor;
|
||||
pid = udd->idProduct;
|
||||
// First Device Descriptor Request (Initially first 8 bytes)
|
||||
rcode = pUsb->getDevDescr( 0, 0, 8, (uint8_t*)buf );
|
||||
|
||||
// Restore p->epinfo
|
||||
p->epinfo = oldep_ptr;
|
||||
|
||||
|
@ -186,6 +185,13 @@ uint8_t USBH_MIDI::Init(uint8_t parent, uint8_t port, bool lowspeed)
|
|||
}
|
||||
p->lowspeed = lowspeed;
|
||||
|
||||
// Second Device Descriptor Request (Full)
|
||||
rcode = pUsb->getDevDescr( bAddress, 0, sizeof(USB_DEVICE_DESCRIPTOR), (uint8_t*)buf );
|
||||
if( rcode ){
|
||||
goto FailGetDevDescr;
|
||||
}
|
||||
vid = udd->idVendor;
|
||||
pid = udd->idProduct;
|
||||
num_of_conf = udd->bNumConfigurations;
|
||||
|
||||
// Assign epInfo to epinfo pointer
|
||||
|
|
Loading…
Reference in a new issue