Extend the automatic serial number descriptor code to read out and send all 10 bytes...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 28 Jul 2009 16:12:09 +0000 (16:12 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 28 Jul 2009 16:12:09 +0000 (16:12 +0000)
LUFA/Drivers/USB/LowLevel/DevChapter9.c
Projects/Magstripe/Descriptors.c

index 8de4bd6..793b55f 100644 (file)
@@ -232,10 +232,10 @@ static void USB_Device_GetInternalSerialDescriptor(void)
        struct\r
        {\r
                USB_Descriptor_Header_t Header;\r
-               int16_t                 UnicodeString[12];\r
+               int16_t                 UnicodeString[20];\r
        } SignatureDescriptor;\r
        \r
-       uint8_t SigReadAddress  = 0x0E;         \r
+       uint8_t SigReadAddress  = 0x0E;\r
        bool    OddNibbleRead   = false;\r
 \r
        #if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)\r
@@ -246,7 +246,7 @@ static void USB_Device_GetInternalSerialDescriptor(void)
                SignatureDescriptor.Header.bDescriptorType = DTYPE_String;\r
        #endif\r
 \r
-       for (uint8_t SerialCharNum = 0; SerialCharNum < 12; SerialCharNum++)\r
+       for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++)\r
        {\r
                uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);\r
                \r
index 68c98ed..7aa6466 100644 (file)
@@ -93,7 +93,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
-       .SerialNumStrIndex      = NO_DESCRIPTOR,\r
+       .SerialNumStrIndex      = USE_INTERNAL_SERIAL,\r
                \r
        .NumberOfConfigurations = 1\r
 };\r