summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-04 17:35:19 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-04 17:35:19 +0000
commit49d757566aca9120bc0b479b72b8aa547959ce7c (patch)
treedc8e23ad0a0d4044bbcd2d4b4488be9bc0146bb8 /nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c
parent3d3a0af8b0d724f46656b6a9cb4a883f374558dc (diff)
downloadpx4-nuttx-49d757566aca9120bc0b479b72b8aa547959ce7c.tar.gz
px4-nuttx-49d757566aca9120bc0b479b72b8aa547959ce7c.tar.bz2
px4-nuttx-49d757566aca9120bc0b479b72b8aa547959ce7c.zip
USB class drivers need to call DEV_CONNECT
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3159 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c')
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c b/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c
index a3bf002a7..8633751ad 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c
@@ -1487,6 +1487,15 @@ static void lpc17_usbreset(struct lpc17_usbdev_s *priv)
lpc17_putreg(USB_SLOW_INT|USB_DEVSTATUS_INT|USB_FAST_INT|USB_FRAME_INT|USB_ERROR_INT,
LPC17_USBDEV_INTEN);
+
+ /* Tell the class driver that we are disconnected. The class
+ * driver should then accept any new configurations.
+ */
+
+ if (priv->driver)
+ {
+ CLASS_DISCONNECT(priv->driver, &priv->usbdev);
+ }
}
/*******************************************************************************
@@ -1895,8 +1904,8 @@ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv)
if (priv->stalled)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_EP0SETUPSTALLED), priv->ep0state);
- lpc17_epstall(&ep0->ep, false);
- lpc17_epstall(&ep0->ep, false);
+ lpc17_epstall(&priv->eplist[LPC17_EP0_IN].ep, false);
+ lpc17_epstall(&priv->eplist[LPC17_EP0_OUT].ep, false);
}
}
@@ -1957,9 +1966,8 @@ static inline void lpc17_ep0dataoutinterrupt(struct lpc17_usbdev_s *priv)
if (priv->stalled)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_EP0OUTSTALLED), priv->ep0state);
- ep0 = &priv->eplist[LPC17_EP0_OUT];
- lpc17_epstall(&ep0->ep, false);
- lpc17_epstall(&ep0->ep, false);
+ lpc17_epstall(&priv->eplist[LPC17_EP0_IN].ep, false);
+ lpc17_epstall(&priv->eplist[LPC17_EP0_OUT].ep, false);
}
return;
}
@@ -2024,9 +2032,8 @@ static inline void lpc17_ep0dataininterrupt(struct lpc17_usbdev_s *priv)
if (priv->stalled)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_EP0INSTALLED), priv->ep0state);
- ep0 = &priv->eplist[LPC17_EP0_IN];
- lpc17_epstall(&ep0->ep, false);
- lpc17_epstall(&ep0->ep, false);
+ lpc17_epstall(&priv->eplist[LPC17_EP0_IN].ep, false);
+ lpc17_epstall(&priv->eplist[LPC17_EP0_OUT].ep, false);
}
}