Trim unique serial number created by the USE_INTERNAL_SERIAL option to 12 characters rather than 20 - apparently Windows will implode if a serial number is too long.
This commit is contained in:
parent
e0420015df
commit
9d506553aa
4 changed files with 5 additions and 4 deletions
|
@ -182,14 +182,14 @@ static void USB_Device_GetDescriptor(void)
|
|||
#if defined(USE_INTERNAL_SERIAL)
|
||||
if (USB_ControlRequest.wValue == ((DTYPE_String << 8) | USE_INTERNAL_SERIAL))
|
||||
{
|
||||
uint8_t SignatureDescriptor[2 + (sizeof(int16_t) * 20)];
|
||||
uint8_t SignatureDescriptor[2 + (sizeof(int16_t) * 12)];
|
||||
|
||||
SignatureDescriptor[0] = sizeof(SignatureDescriptor);
|
||||
SignatureDescriptor[1] = DTYPE_String;
|
||||
|
||||
uint16_t* SigUnicodeChars = (uint16_t*)&SignatureDescriptor[2];
|
||||
|
||||
for (uint8_t SerialByteNum = 0; SerialByteNum < 10; SerialByteNum++)
|
||||
for (uint8_t SerialByteNum = 0; SerialByteNum < 6; SerialByteNum++)
|
||||
{
|
||||
char ConvSigString[3];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue