diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-12-04 17:35:19 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-12-04 17:35:19 +0000 |
commit | 49d757566aca9120bc0b479b72b8aa547959ce7c (patch) | |
tree | dc8e23ad0a0d4044bbcd2d4b4488be9bc0146bb8 /nuttx/arch | |
parent | 3d3a0af8b0d724f46656b6a9cb4a883f374558dc (diff) | |
download | px4-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')
-rwxr-xr-x | nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c | 23 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc313x/lpc313x_usbdev.c | 6 |
2 files changed, 20 insertions, 9 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); } } diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_usbdev.c b/nuttx/arch/arm/src/lpc313x/lpc313x_usbdev.c index 323648fa9..c3faecee1 100755 --- a/nuttx/arch/arm/src/lpc313x/lpc313x_usbdev.c +++ b/nuttx/arch/arm/src/lpc313x/lpc313x_usbdev.c @@ -2604,7 +2604,11 @@ int usbdev_register(struct usbdevclass_driver_s *driver) /* FIXME: nothing seems to call DEV_CONNECT(), but we need to set * the RS bit to enable the controller. It kind of makes sense - * to do this after the class has bound to us... */ + * to do this after the class has bound to us... + * GEN: This bug is really in the class driver. It should make the + * soft connect when it is ready to be enumerated. I have added + * that logic to the class drivers but left this logic here. + */ lpc313x_pullup(&g_usbdev.usbdev, true); } |