mirror of
https://github.com/apache/nuttx.git
synced 2026-10-07 14:25:25 +00:00
usbdev: Use composite devices as universal devices
The enumeration process for composite and non-composite devices has a lot of duplicate code. Treating the code for composite devices as universal enumeration code can reduce redundant code. Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
parent
d55e0cce9c
commit
fe6b0619f9
6 changed files with 103 additions and 105 deletions
|
|
@ -28,8 +28,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#include <nuttx/usb/usbdev.h>
|
||||
|
||||
#ifdef CONFIG_USBDEV_COMPOSITE
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
|
@ -142,5 +140,4 @@ int composite_ep0submit(FAR struct usbdevclass_driver_s *driver,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USBDEV_COMPOSITE */
|
||||
#endif /* __INCLUDE_NUTTX_USB_COMPOSITE_H */
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ struct usbdev_devinfo_s
|
|||
int epno[5]; /* Array holding the endpoint configuration for this device */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_USBDEV_COMPOSITE
|
||||
struct usbdevclass_driver_s;
|
||||
struct composite_devdesc_s
|
||||
{
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
|
|
@ -213,7 +213,6 @@ struct composite_devdesc_s
|
|||
|
||||
struct usbdev_devinfo_s devinfo;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* struct usbdev_req_s - describes one i/o request */
|
||||
|
||||
|
|
@ -315,7 +314,6 @@ struct usbdev_s
|
|||
|
||||
/* USB Device Class Implementations *****************************************/
|
||||
|
||||
struct usbdevclass_driver_s;
|
||||
struct usbdevclass_driverops_s
|
||||
{
|
||||
CODE int (*bind)(FAR struct usbdevclass_driver_s *driver,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue