The composite USB device is basically functional (more testing needed)

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4343 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-01-27 18:33:41 +00:00
parent d1a2336ce3
commit a79c599632
4 changed files with 252 additions and 241 deletions
+241 -235
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -189,13 +189,13 @@ static int composite_classsetup(FAR struct composite_dev_s *priv,
index = GETUINT16(ctrl->index);
interface = (uint8_t)(index & 0xff);
if (interface >= DEV1_FIRSTINTERFACE && interface <= (DEV1_FIRSTINTERFACE + DEV1_NINTERFACES))
if (interface >= DEV1_FIRSTINTERFACE && interface < (DEV1_FIRSTINTERFACE + DEV1_NINTERFACES))
{
ret = CLASS_SETUP(priv->dev1, dev, ctrl);
}
else if (interface >= DEV2_FIRSTINTERFACE && interface <= (DEV2_FIRSTINTERFACE + DEV2_NINTERFACES))
else if (interface >= DEV2_FIRSTINTERFACE && interface < (DEV2_FIRSTINTERFACE + DEV2_NINTERFACES))
{
ret = CLASS_SETUP(priv->dev1, dev, ctrl);
ret = CLASS_SETUP(priv->dev2, dev, ctrl);
}
return ret;
@@ -505,7 +505,7 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver,
if (ret >= 0)
{
ret = CLASS_SETUP(priv->dev1, dev, ctrl);
ret = CLASS_SETUP(priv->dev2, dev, ctrl);
if (ret >= 0)
{
priv->config = value;
+6 -2
View File
@@ -710,7 +710,7 @@ static int usbmsc_setup(FAR struct usbdevclass_driver_s *driver,
break;
}
}
else
else if ((ctrl->type & USB_REQ_TYPE_MASK) == USB_REQ_TYPE_CLASS)
{
/**********************************************************************
* Bulk-Only Mass Storage Class Requests
@@ -775,10 +775,14 @@ static int usbmsc_setup(FAR struct usbdevclass_driver_s *driver,
break;
default:
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_BADREQUEST), index);
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_BADREQUEST), ctrl->req);
break;
}
}
else
{
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_UNSUPPORTEDTYPE), ctrl->type);
}
/* Respond to the setup command if data was returned. On an error return
* value (ret < 0), the USB driver will stall EP0.
+1
View File
@@ -382,6 +382,7 @@
#define USBMSC_TRACEERR_WRITE6READONLY 0x0075
#define USBMSC_TRACEERR_WRSHUTDOWN 0x0076
#define USBMSC_TRACEERR_WRUNEXPECTED 0x0077
#define USBMSC_TRACEERR_UNSUPPORTEDTYPE 0x0078
/****************************************************************************
* Public Types