aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP-MKII/AVRISPDescriptors.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-09-03 20:26:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-09-03 20:26:34 +0000
commitb01ebe2d3774dfba696cf586221f6352d6cd0503 (patch)
tree55615039a7c6c87ff6aa26944569b548f05e17f4 /Projects/AVRISP-MKII/AVRISPDescriptors.c
parentb5d9239111b87287befa657eceea41784ec59a07 (diff)
downloadlufa-b01ebe2d3774dfba696cf586221f6352d6cd0503.tar.gz
lufa-b01ebe2d3774dfba696cf586221f6352d6cd0503.tar.bz2
lufa-b01ebe2d3774dfba696cf586221f6352d6cd0503.zip
Alter the AVRISP-MKII clone project code to report a different serial number in libUSB compatibility mode, so that both the Jungo drivers and the libUSB drivers can be installed at the same time (and switched back and forth based on the current compatibility mode).
Diffstat (limited to 'Projects/AVRISP-MKII/AVRISPDescriptors.c')
-rw-r--r--Projects/AVRISP-MKII/AVRISPDescriptors.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Projects/AVRISP-MKII/AVRISPDescriptors.c b/Projects/AVRISP-MKII/AVRISPDescriptors.c
index 9ad7c1545..066dcf414 100644
--- a/Projects/AVRISP-MKII/AVRISPDescriptors.c
+++ b/Projects/AVRISP-MKII/AVRISPDescriptors.c
@@ -174,7 +174,7 @@ const USB_Descriptor_String_t PROGMEM AVRISP_ProductString =
/** Serial number string. This is a Unicode string containing the device's unique serial number, expressed as a
* series of uppercase hexadecimal digits.
*/
-const USB_Descriptor_String_t PROGMEM AVRISP_SerialString =
+USB_Descriptor_String_t AVRISP_SerialString =
{
.Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
@@ -233,7 +233,12 @@ uint16_t AVRISP_GetDescriptor(const uint16_t wValue,
break;
case 0x03:
Address = &AVRISP_SerialString;
- Size = pgm_read_byte(&AVRISP_SerialString.Header.Size);
+ Size = AVRISP_SerialString.Header.Size;
+
+ /* Update serial number to have a different serial based on the current endpoint address */
+ ((uint16_t*)&AVRISP_SerialString.UnicodeString)[6] = cpu_to_le16('0' + (AVRISP_DATA_IN_EPADDR & ENDPOINT_EPNUM_MASK));
+
+ *DescriptorMemorySpace = MEMSPACE_RAM;
break;
}