usb: don't include date in serial, so we can have a constant by id path
This commit is contained in:
parent
1b857110ce
commit
6e05f18d2b
|
@ -223,7 +223,7 @@ static const struct usb_config_descriptor usb_cdcacm_configuration_descriptor =
|
|||
};
|
||||
|
||||
/** device ID used as serial number */
|
||||
static char usb_serial[] = "H_YYYY-MM-DD_AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD";
|
||||
static char usb_serial[] = "H_AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD";
|
||||
|
||||
/** USB string table
|
||||
* @note starting with index 1
|
||||
|
@ -432,7 +432,8 @@ static void usb_cdcacm_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
|||
|
||||
void usb_cdcacm_setup(void)
|
||||
{
|
||||
snprintf(usb_serial, LENGTH(usb_serial), "%08x%08x%04x%04x", DESIG_UNIQUE_ID2, DESIG_UNIQUE_ID1, DESIG_UNIQUE_ID0 & 0xffff, DESIG_UNIQUE_ID0 >> 16); // set actual device ID as serial
|
||||
// set serial
|
||||
snprintf(usb_serial, sizeof(usb_serial), "%c_%08x%08x%08x", busvoodoo_version, DESIG_UNIQUE_ID0, DESIG_UNIQUE_ID1, DESIG_UNIQUE_ID2);
|
||||
|
||||
// initialize USB
|
||||
rcc_periph_reset_pulse(RST_USB); // reset USB peripheral
|
||||
|
|
Loading…
Reference in New Issue