Skip to content
Snippets Groups Projects
Commit dbc7da47 authored by patacongo's avatar patacongo
Browse files

Missed part of last change

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3232 42af7a65-404d-4744-a932-0658087f49c3
parent 1b2c0572
No related branches found
No related tags found
No related merge requests found
......@@ -395,11 +395,11 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr,
*/
}
/* Set the device address to 1 */
/* Set the USB device address to the value in the 'funcaddr' input */
ctrlreq->type = USB_REQ_DIR_OUT|USB_REQ_RECIPIENT_DEVICE;
ctrlreq->req = USB_REQ_SETADDRESS;
usbhost_putle16(ctrlreq->value, 1);
usbhost_putle16(ctrlreq->value, (uint16_t)funcaddr);
usbhost_putle16(ctrlreq->index, 0);
usbhost_putle16(ctrlreq->len, 0);
......@@ -411,12 +411,13 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr,
}
up_mdelay(2);
/* Modify control pipe with function address 1 */
/* Modify control pipe with the provided USB device address */
DRVR_EP0CONFIGURE(drvr, 1, maxpacketsize);
DRVR_EP0CONFIGURE(drvr, funcaddr, maxpacketsize);
/* Get the configuration descriptor (only), index == 0. More logic is
* needed in order to handle devices with multiple configurations.
/* Get the configuration descriptor (only), index == 0. Should not be
* hard-coded! More logic is needed in order to handle devices with
* multiple configurations.
*/
ctrlreq->type = USB_REQ_DIR_IN|USB_REQ_RECIPIENT_DEVICE;
......@@ -437,7 +438,9 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr,
cfglen = (unsigned int)usbhost_getle16(((struct usb_cfgdesc_s *)buffer)->totallen);
uvdbg("sizeof config data: %d\n", cfglen);
/* Get all of the configuration descriptor data, index == 0 */
/* Get all of the configuration descriptor data, index == 0 (Should not be
* hard-coded!)
*/
ctrlreq->type = USB_REQ_DIR_IN|USB_REQ_RECIPIENT_DEVICE;
ctrlreq->req = USB_REQ_GETDESCRIPTOR;
......@@ -452,7 +455,7 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr,
goto errout;
}
/* Select device configuration 1 */
/* Select device configuration 1 (Should not be hard-coded!) */
ctrlreq->type = USB_REQ_DIR_OUT|USB_REQ_RECIPIENT_DEVICE;
ctrlreq->req = USB_REQ_SETCONFIGURATION;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment