Fixed for compatibility with Paradigma USB Serial device.
Fork of USBHost by
Diff: USBHost/USBHost.cpp
- Revision:
- 11:2d5162435580
- Parent:
- 10:0c11cf1cc218
--- a/USBHost/USBHost.cpp Mon Mar 18 14:46:56 2013 +0000 +++ b/USBHost/USBHost.cpp Sat Jun 22 10:48:26 2013 +0000 @@ -155,7 +155,7 @@ Thread::wait(100); } - USB_INFO("New device connected: %p [hub: %d - port: %d]", &devices[i], usb_msg->hub, usb_msg->port); + USB_INFO("New device connected: %p [hub: %d - port: %d - class: %d]", &devices[i], usb_msg->hub, usb_msg->port, buf[4]); #if MAX_HUB_NB if (buf[4] == HUB_CLASS) { @@ -907,12 +907,14 @@ while (index < len) { len_desc = conf_descr[index]; id = conf_descr[index+1]; + USB_INFO("Next ID in ConfDescr"); switch (id) { case CONFIGURATION_DESCRIPTOR: USB_DBG("dev: %p has %d intf", dev, conf_descr[4]); dev->setNbIntf(conf_descr[4]); break; case INTERFACE_DESCRIPTOR: + USB_INFO("Interface_Descriptor found !"); if(pEnumerator->parseInterface(conf_descr[index + 2], conf_descr[index + 5], conf_descr[index + 6], conf_descr[index + 7])) { if (intf_nb++ <= MAX_INTF) { current_intf = conf_descr[index + 2]; @@ -928,8 +930,10 @@ } break; case ENDPOINT_DESCRIPTOR: + USB_INFO("Endpoint_Descriptor found!"); if (parsing_intf && (intf_nb <= MAX_INTF) ) { if (nb_endpoints_used < MAX_ENDPOINT_PER_INTERFACE) { + USB_INFO("Making call to useEndpoint"); if( pEnumerator->useEndpoint(current_intf, (ENDPOINT_TYPE)(conf_descr[index + 3] & 0x03), (ENDPOINT_DIRECTION)((conf_descr[index + 2] >> 7) + 1)) ) { // if the USBEndpoint is isochronous -> skip it (TODO: fix this) if ((conf_descr[index + 3] & 0x03) != ISOCHRONOUS_ENDPOINT) {