diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-28 22:28:49 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-28 22:28:49 +0000 |
commit | 298457d9a26dcc3d7ddefdee13fdf2dca62e3b27 (patch) | |
tree | 95dd623e1186c4415ee7eb277f57f0ed095355f0 /nuttx/drivers/usbhost/usbhost_storage.c | |
parent | d4d063b22adad543dddc12bbe49e91f03cb8f092 (diff) |
Slightly improved delay logic for the USB host
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5064 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_storage.c')
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_storage.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index 853287371d..2e3136b339 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -42,6 +42,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include <semaphore.h> #include <assert.h> #include <errno.h> @@ -724,6 +725,7 @@ static inline int usbhost_testunitready(FAR struct usbhost_state_s *priv) usbhost_dumpcsw((FAR struct usbmsc_csw_s *)priv->tbuffer); } } + return result; } @@ -1195,13 +1197,15 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) uvdbg("Get max LUN\n"); ret = usbhost_maxlunreq(priv); - /* Wait for the unit to be ready */ - - for (retries = 0; retries < USBHOST_MAX_RETRIES && ret == OK; retries++) + for (retries = 0; retries < USBHOST_MAX_RETRIES /* && ret == OK */; retries++) { uvdbg("Test unit ready, retries=%d\n", retries); - /* Send TESTUNITREADY to see the unit is ready */ + /* Wait just a bit */ + + usleep(50*1000); + + /* Send TESTUNITREADY to see if the unit is ready */ ret = usbhost_testunitready(priv); if (ret == OK) |