summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-21 12:13:16 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-21 12:13:16 +0000
commita762369011709ed9ad6308bfc8ee06df46195026 (patch)
tree707da7a93c7bd4b2bc8f2895da97de234931fab2 /nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
parentec31cad010f368e728491ade3315e2778dbf3bae (diff)
downloadnuttx-a762369011709ed9ad6308bfc8ee06df46195026.tar.gz
nuttx-a762369011709ed9ad6308bfc8ee06df46195026.tar.bz2
nuttx-a762369011709ed9ad6308bfc8ee06df46195026.zip
Need to init IO buffer free list
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3210 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c')
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c b/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
index 6e47753c6..ed79e4e3c 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
@@ -115,6 +115,7 @@
#define EDFREE ((struct lpc17_hced_s *)LPC17_EDFREE_BASE)
#define TDFREE ((uint8_t *)LPC17_TDFREE_BASE)
+#define IOFREE ((uint8_t *)LPC17_IOFREE_BASE)
/* Descriptors *****************************************************************/
@@ -1575,7 +1576,7 @@ FAR struct usbhost_driver_s *usbhost_initialize(int controller)
{
struct lpc17_usbhost_s *priv = &g_usbhost;
uint32_t regval;
- uint8_t *tdfree;
+ uint8_t *buffer;
irqstate_t flags;
int i;
@@ -1641,14 +1642,27 @@ FAR struct usbhost_driver_s *usbhost_initialize(int controller)
/* Initialize user-configurable TD buffers */
- tdfree = TDFREE;
+ buffer = TDFREE;
for (i = 0; i < CONFIG_USBHOST_NEDS; i++)
{
/* Put the TD buffer in a free list */
- lpc17_tdfree(priv, tdfree);
- tdfree += CONFIG_USBHOST_TDBUFSIZE;
+ lpc17_tdfree(priv, buffer);
+ buffer += CONFIG_USBHOST_TDBUFSIZE;
+ }
+
+#ifdef CONFIG_UBHOST_AHBIOBUFFERS
+ /* Initialize user-configurable IO buffers */
+
+ buffer = IOFREE;
+ for (i = 0; i < LPC17_IOBUFFERS; i++)
+ {
+ /* Put the TD buffer in a free list */
+
+ lpc17_iofree(priv, buffer);
+ buffer += CONFIG_USBHOST_IOBUFSIZE;
}
+#endif
/* Wait 50MS then perform hardware reset */