diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-28 22:28:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-28 22:28:49 +0000 |
commit | 3604c9bff925d1f87bec66a23fc713071fcebd02 (patch) | |
tree | 95dd623e1186c4415ee7eb277f57f0ed095355f0 /nuttx/drivers/usbhost/usbhost_enumerate.c | |
parent | ccdea01ff6293d76badc915f0f1e96b770b7bdbe (diff) | |
download | px4-nuttx-3604c9bff925d1f87bec66a23fc713071fcebd02.tar.gz px4-nuttx-3604c9bff925d1f87bec66a23fc713071fcebd02.tar.bz2 px4-nuttx-3604c9bff925d1f87bec66a23fc713071fcebd02.zip |
Slightly improved delay logic for the USB host
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5064 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_enumerate.c')
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_enumerate.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_enumerate.c b/nuttx/drivers/usbhost/usbhost_enumerate.c index 36bfa20d1..26b93bf36 100644 --- a/nuttx/drivers/usbhost/usbhost_enumerate.c +++ b/nuttx/drivers/usbhost/usbhost_enumerate.c @@ -42,6 +42,7 @@ #include <sys/types.h> #include <stdint.h> #include <string.h> +#include <unistd.h> #include <errno.h> #include <assert.h> #include <debug.h> @@ -317,7 +318,7 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr, DEBUGASSERT(drvr && class); - /* Allocate TD buffers for use in this function. We will need two: + /* Allocate descriptor buffers for use in this function. We will need two: * One for the request and one for the data buffer. */ @@ -400,7 +401,7 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr, udbg("ERROR: SETADDRESS DRVR_CTRLOUT returned %d\n", ret); goto errout; } - up_mdelay(2); + usleep(2*1000); /* Modify control pipe with the provided USB device address */ @@ -461,9 +462,9 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr, goto errout; } - /* Free the TD that we were using for the request buffer. It is not needed - * further here but it may be needed by the class driver during its connection - * operations. + /* Free the descriptor buffer that we were using for the request buffer. + * It is not needed further here but it may be needed by the class driver + * during its connection operations. */ DRVR_FREE(drvr, (uint8_t*)ctrlreq); @@ -488,9 +489,9 @@ int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr, } } - /* Some devices may require this delay before initialization */ + /* Some devices may require some delay before initialization */ - up_mdelay(100); + usleep(100*1000); /* Parse the configuration descriptor and bind to the class instance for the * device. This needs to be the last thing done because the class driver |