1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-07-03 02:33:16 +03:00

atusb/fw/usb/: DFU_ITF_DESCR also needs a protocol argument

- dfu.h (enum dfu_itf_proto): bInterfaceProtocol values for DFU
  functional descriptor
- dfu.h (DFU_ITF_DESCR): added protocol argument
- dfu.c (config_descriptor): pass protocol to DFU_ITF_DESCR
This commit is contained in:
Werner Almesberger 2011-06-10 23:15:51 -03:00
parent 2544004a86
commit 5f50611735
2 changed files with 8 additions and 3 deletions

View File

@ -76,7 +76,7 @@ const uint8_t config_descriptor[] = {
/* Interface #0 */
DFU_ITF_DESCR(0)
DFU_ITF_DESCR(0, dfu_proto_dfu)
};

View File

@ -62,6 +62,11 @@ enum dfu_state {
dfuERROR
};
enum dfu_itf_proto {
dfu_proto_runtime = 1, /* Runtime protocol */
dfu_proto_dfu = 2, /* DFU mode protocol */
};
#define DFU_DT_FUNCTIONAL 0x21 /* DFU FUNCTIONAL descriptor type */
@ -78,7 +83,7 @@ struct dfu {
};
#define DFU_ITF_DESCR(itf) \
#define DFU_ITF_DESCR(itf, proto) \
9, /* bLength */ \
USB_DT_INTERFACE, /* bDescriptorType */ \
(itf), /* bInterfaceNumber */ \
@ -86,7 +91,7 @@ struct dfu {
0, /* bNumEndpoints */ \
0xfe, /* bInterfaceClass (application specific) */ \
0x01, /* bInterfaceSubClass (device fw upgrade) */ \
0x02, /* bInterfaceProtocol (DFU mode protocol) */ \
(proto), /* bInterfaceProtocol (dfu_proto_*) */ \
0, /* iInterface */