mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 13:12:08 +00:00
Extend the automatic serial number descriptor code to read out and send all 10 bytes (20 characters) of the internal serial number on supported AVRs, rather than just the first 6 bytes (12 characters).
This commit is contained in:
parent
7f3f39b575
commit
6928f17b64
@ -232,7 +232,7 @@ static void USB_Device_GetInternalSerialDescriptor(void)
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
USB_Descriptor_Header_t Header;
|
USB_Descriptor_Header_t Header;
|
||||||
int16_t UnicodeString[12];
|
int16_t UnicodeString[20];
|
||||||
} SignatureDescriptor;
|
} SignatureDescriptor;
|
||||||
|
|
||||||
uint8_t SigReadAddress = 0x0E;
|
uint8_t SigReadAddress = 0x0E;
|
||||||
@ -246,7 +246,7 @@ static void USB_Device_GetInternalSerialDescriptor(void)
|
|||||||
SignatureDescriptor.Header.bDescriptorType = DTYPE_String;
|
SignatureDescriptor.Header.bDescriptorType = DTYPE_String;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (uint8_t SerialCharNum = 0; SerialCharNum < 12; SerialCharNum++)
|
for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++)
|
||||||
{
|
{
|
||||||
uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
|
uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
|
|
||||||
.ManufacturerStrIndex = 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
.ProductStrIndex = 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
.SerialNumStrIndex = NO_DESCRIPTOR,
|
.SerialNumStrIndex = USE_INTERNAL_SERIAL,
|
||||||
|
|
||||||
.NumberOfConfigurations = 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user