1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-23 08:39:55 +02:00

atusb/fw/usb/dfu.h: define DFU interface descriptor, for later sharing

- dfu.h (DFU_ITF_DESCR): define DFU interface descriptor
- dfu.c (config_descriptor): use DFU_ITF_DESCR instead of open-coding
  the descriptor
This commit is contained in:
Werner Almesberger 2011-06-10 19:27:19 -03:00
parent 3cc92cc4a6
commit 7a2c785e29
2 changed files with 13 additions and 9 deletions

View File

@ -77,15 +77,7 @@ const uint8_t config_descriptor[] = {
/* Interface #0 */
9, /* bLength */
USB_DT_INTERFACE, /* bDescriptorType */
0, /* bInterfaceNumber */
0, /* bAlternateSetting */
0, /* bNumEndpoints */
0xfe, /* bInterfaceClass (application specific) */
0x01, /* bInterfaceSubClass (device fw upgrade) */
0x02, /* bInterfaceProtocol (DFU mode protocol) */
0, /* iInterface */
DFU_ITF_DESCR(0)
};

View File

@ -78,6 +78,18 @@ struct dfu {
};
#define DFU_ITF_DESCR(itf) \
9, /* bLength */ \
USB_DT_INTERFACE, /* bDescriptorType */ \
(itf), /* bInterfaceNumber */ \
0, /* bAlternateSetting */ \
0, /* bNumEndpoints */ \
0xfe, /* bInterfaceClass (application specific) */ \
0x01, /* bInterfaceSubClass (device fw upgrade) */ \
0x02, /* bInterfaceProtocol (DFU mode protocol) */ \
0, /* iInterface */
extern struct dfu dfu;