1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 14:10:37 +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 */ /* Interface #0 */
9, /* bLength */ DFU_ITF_DESCR(0)
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 */
}; };

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; extern struct dfu dfu;