samples: dfu: fix usb configuration descriptor length
The macros for calculating the length of the configuration descriptors have been interchanged, fix it, and use the correct macro for the length of the DFU mode configuration descriptor. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
parent
35b34c2e65
commit
a8d7659a63
|
@ -197,8 +197,8 @@ static const u8_t dfu_mode_usb_description[] = {
|
|||
USB_CONFIGURATION_DESC_SIZE, /* Descriptor size */
|
||||
USB_CONFIGURATION_DESC, /* Descriptor type */
|
||||
/* Total length in bytes of data returned */
|
||||
LOW_BYTE(DFU_RUNTIME_CONF_SIZE),
|
||||
HIGH_BYTE(DFU_RUNTIME_CONF_SIZE),
|
||||
LOW_BYTE(DFU_MODE_CONF_SIZE),
|
||||
HIGH_BYTE(DFU_MODE_CONF_SIZE),
|
||||
DFU_NUM_ITF, /* Number of interfaces */
|
||||
0x01, /* Configuration value */
|
||||
0x00, /* Index of the Configuration string */
|
||||
|
|
|
@ -116,11 +116,11 @@ enum dfu_state {
|
|||
* For DFU: CONF + ITF*ALT_SETTINGS + DFU)
|
||||
*/
|
||||
#define DFU_MODE_CONF_SIZE (USB_CONFIGURATION_DESC_SIZE + \
|
||||
USB_INTERFACE_DESC_SIZE * DFU_RUNTIME_ALTERNATE_SETTINGS + \
|
||||
USB_INTERFACE_DESC_SIZE * DFU_MODE_ALTERNATE_SETTINGS + \
|
||||
USB_DFU_DESC_SIZE)
|
||||
|
||||
#define DFU_RUNTIME_CONF_SIZE (USB_CONFIGURATION_DESC_SIZE + \
|
||||
USB_INTERFACE_DESC_SIZE * DFU_MODE_ALTERNATE_SETTINGS + \
|
||||
USB_INTERFACE_DESC_SIZE * DFU_RUNTIME_ALTERNATE_SETTINGS + \
|
||||
USB_DFU_DESC_SIZE)
|
||||
|
||||
/* Alternate settings are used to access additional memory segments.
|
||||
|
|
Loading…
Reference in a new issue