DFU: runtime only has _one_ interface/altsetting
This commit is contained in:
parent
7261a4b6b7
commit
3505594094
|
@ -46,54 +46,26 @@ struct dfu_desc {
|
|||
.bcdDFUVersion = 0x0100, \
|
||||
}
|
||||
|
||||
#define DFU_IF_DESCRIPTORS_STRUCT \
|
||||
USBInterfaceDescriptor dfu_interface[DFU_NUM_IF];
|
||||
#define DFURT_NUM_IF 1
|
||||
|
||||
#define DFU_IF_DESCRIPTORS { \
|
||||
{ \
|
||||
#define DFURT_IF_DESCRIPTOR_STRUCT \
|
||||
USBInterfaceDescriptor dfu_rt; \
|
||||
struct usb_dfu_func_descriptor func_dfu;
|
||||
|
||||
|
||||
#define DFURT_IF_DESCRIPTOR(dfuIF, dfuSTR) \
|
||||
.dfu_rt = { \
|
||||
.bLength = sizeof(USBInterfaceDescriptor), \
|
||||
.bDescriptorType = USBGenericDescriptor_INTERFACE, \
|
||||
.bInterfaceNumber = CONFIG_DFU_NUM_APP_IF, \
|
||||
.bInterfaceNumber = dfuIF, \
|
||||
.bAlternateSetting = 0, \
|
||||
.bNumEndpoints = 0, \
|
||||
.bInterfaceClass = 0xFE, \
|
||||
.bInterfaceSubClass = 0x01, \
|
||||
.bInterfaceProtocol = 0x01, \
|
||||
.iInterface = CONFIG_DFU_NUM_APP_STR, \
|
||||
.iInterface = dfuSTR, \
|
||||
}, \
|
||||
{ \
|
||||
.bLength = sizeof(USBInterfaceDescriptor), \
|
||||
.bDescriptorType = USBGenericDescriptor_INTERFACE, \
|
||||
.bInterfaceNumber = CONFIG_DFU_NUM_APP_IF+1, \
|
||||
.bAlternateSetting = 0, \
|
||||
.bNumEndpoints = 0, \
|
||||
.bInterfaceClass = 0xFE, \
|
||||
.bInterfaceSubClass = 0x01, \
|
||||
.bInterfaceProtocol = 0x01, \
|
||||
.iInterface = CONFIG_DFU_NUM_APP_STR+1, \
|
||||
}, \
|
||||
{ \
|
||||
.bLength = sizeof(USBInterfaceDescriptor), \
|
||||
.bDescriptorType = USBGenericDescriptor_INTERFACE, \
|
||||
.bInterfaceNumber = CONFIG_DFU_NUM_APP_IF+2, \
|
||||
.bAlternateSetting = 0, \
|
||||
.bNumEndpoints = 0, \
|
||||
.bInterfaceClass = 0xFE, \
|
||||
.bInterfaceSubClass = 0x01, \
|
||||
.bInterfaceProtocol = 0x01, \
|
||||
.iInterface = CONFIG_DFU_NUM_APP_STR+2, \
|
||||
}, \
|
||||
}
|
||||
|
||||
extern const struct USBStringDescriptor USBDFU_string1;
|
||||
extern const struct USBStringDescriptor USBDFU_string2;
|
||||
extern const struct USBStringDescriptor USBDFU_string3;
|
||||
|
||||
#define DFU_NUM_STRINGS 3
|
||||
#define DFU_STRING_DESCRIPTORS \
|
||||
(const unsigned char *) &USBDFU_string1, \
|
||||
(const unsigned char *) &USBDFU_string2, \
|
||||
(const unsigned char *) &USBDFU_string3,
|
||||
.func_dfu = DFU_FUNC_DESC \
|
||||
|
||||
const struct dfu_desc dfu_cfg_descriptor;
|
||||
const USBDDriverDescriptors dfu_descriptors;
|
||||
|
@ -101,12 +73,9 @@ const USBDDriverDescriptors dfu_descriptors;
|
|||
#else /* BOARD_USB_DFU */
|
||||
|
||||
/* no DFU bootloader is being used */
|
||||
#define DFU_NUM_IF 0
|
||||
#define DFU_IF_DESCRIPTORS_STRUCT
|
||||
#define DFU_IF_DESCRIPTORS
|
||||
|
||||
#define DFU_NUM_STRINGS 0
|
||||
#define DFU_STRING_DESCRIPTORS
|
||||
#define DFURT_NUM_IF 0
|
||||
#define DFURT_IF_DESCRIPTOR_STRUCT(a, b)
|
||||
#define DFURT_IF_DESCRIPTOR
|
||||
|
||||
#endif /* BOARD_USB_DFU */
|
||||
|
||||
|
|
Loading…
Reference in New Issue