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:
parent
3cc92cc4a6
commit
7a2c785e29
@ -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 */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user