fix(h7): device version in DFU mode (#6513)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
co-authored by
raphaelcoeffic
parent
dc75c4f39b
commit
58532bbb5b
@@ -297,6 +297,10 @@ uint8_t * USBD_FS_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
|
|||||||
|
|
||||||
int vid, pid;
|
int vid, pid;
|
||||||
|
|
||||||
|
/* version has to be bcd coded */
|
||||||
|
uint8_t version_minor = ((VERSION_MINOR / 10) << 4) | (VERSION_MINOR % 10);
|
||||||
|
uint8_t version_major = ((VERSION_MAJOR / 10) << 4) | (VERSION_MAJOR % 10);
|
||||||
|
|
||||||
switch (getSelectedUsbMode()) {
|
switch (getSelectedUsbMode()) {
|
||||||
case USB_JOYSTICK_MODE:
|
case USB_JOYSTICK_MODE:
|
||||||
vid = USBD_HID_VID;
|
vid = USBD_HID_VID;
|
||||||
@@ -316,6 +320,9 @@ uint8_t * USBD_FS_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
|
|||||||
case USB_DFU_MODE:
|
case USB_DFU_MODE:
|
||||||
vid = USBD_DFU_VID;
|
vid = USBD_DFU_VID;
|
||||||
pid = USBD_DFU_PID;
|
pid = USBD_DFU_PID;
|
||||||
|
// H7RS and H750 both use 2.00 as 'bcdDevice' version
|
||||||
|
version_major = 0x02;
|
||||||
|
version_minor = 0x00;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
@@ -323,10 +330,6 @@ uint8_t * USBD_FS_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
|
|||||||
pid = 0;
|
pid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* version has to be bcd coded */
|
|
||||||
uint8_t version_minor = ((VERSION_MINOR / 10) << 4) | (VERSION_MINOR % 10);
|
|
||||||
uint8_t version_major = ((VERSION_MAJOR / 10) << 4) | (VERSION_MAJOR % 10);
|
|
||||||
|
|
||||||
/* USB Standard Device Descriptor */
|
/* USB Standard Device Descriptor */
|
||||||
__ALIGN_BEGIN const uint8_t USBD_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END =
|
__ALIGN_BEGIN const uint8_t USBD_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END =
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user