aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-21 09:22:31 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-21 09:22:31 +0000
commit730624f745648cbd32bec7da64833cb2aadd44ea (patch)
tree1fc67eab7c45f67d3005d3dfdb614629a47c3567 /Demos/Device/ClassDriver
parent9d506553aa750264ff6045ff9180397993cb37c0 (diff)
downloadlufa-730624f745648cbd32bec7da64833cb2aadd44ea.tar.gz
lufa-730624f745648cbd32bec7da64833cb2aadd44ea.tar.bz2
lufa-730624f745648cbd32bec7da64833cb2aadd44ea.zip
Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device's serial number, added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code. Updated Mass Storage and CDC based demos to use the new device serial number if the device it is compiled for supports it.
Diffstat (limited to 'Demos/Device/ClassDriver')
-rw-r--r--Demos/Device/ClassDriver/CDC/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/DualCDC/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/MassStorage/Descriptors.c20
-rw-r--r--Demos/Device/ClassDriver/USBtoSerial/Descriptors.c2
4 files changed, 4 insertions, 22 deletions
diff --git a/Demos/Device/ClassDriver/CDC/Descriptors.c b/Demos/Device/ClassDriver/CDC/Descriptors.c
index 9a2fe5e68..1cdad8e8f 100644
--- a/Demos/Device/ClassDriver/CDC/Descriptors.c
+++ b/Demos/Device/ClassDriver/CDC/Descriptors.c
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
- .SerialNumStrIndex = NO_DESCRIPTOR,
+ .SerialNumStrIndex = USE_INTERNAL_SERIAL,
.NumberOfConfigurations = 1
};
diff --git a/Demos/Device/ClassDriver/DualCDC/Descriptors.c b/Demos/Device/ClassDriver/DualCDC/Descriptors.c
index 951a5586c..92b3eb930 100644
--- a/Demos/Device/ClassDriver/DualCDC/Descriptors.c
+++ b/Demos/Device/ClassDriver/DualCDC/Descriptors.c
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
- .SerialNumStrIndex = NO_DESCRIPTOR,
+ .SerialNumStrIndex = USE_INTERNAL_SERIAL,
.NumberOfConfigurations = 1
};
diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.c b/Demos/Device/ClassDriver/MassStorage/Descriptors.c
index 6c02a6c55..13d18a69d 100644
--- a/Demos/Device/ClassDriver/MassStorage/Descriptors.c
+++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.c
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
- .SerialNumStrIndex = 0x03,
+ .SerialNumStrIndex = USE_INTERNAL_SERIAL,
.NumberOfConfigurations = 1
};
@@ -156,20 +156,6 @@ USB_Descriptor_String_t PROGMEM ProductString =
.UnicodeString = L"LUFA Mass Storage Demo"
};
-/** Serial number descriptor string. This is a Unicode string containing a string of HEX characters at least 12
- * digits in length to uniquely identify a device when concatenated with the device's Vendor and Product IDs. By
- * using the unique serial number string to identify a device, the device drivers do not need to be reinstalled
- * each time the device is inserted into a different USB port on the same system. <b>This should be unique between
- * devices, or conflicts will occur if two devices sharing the same serial number are inserted into the same system
- * at the same time.</b>
- */
-USB_Descriptor_String_t PROGMEM SerialNumberString =
-{
- .Header = {.Size = USB_STRING_LEN(12), .Type = DTYPE_String},
-
- .UnicodeString = L"000000000000"
-};
-
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given
* to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function
@@ -209,10 +195,6 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
Address = (void*)&ProductString;
Size = pgm_read_byte(&ProductString.Header.Size);
break;
- case 0x03:
- Address = (void*)&SerialNumberString;
- Size = pgm_read_byte(&SerialNumberString.Header.Size);
- break;
}
break;
diff --git a/Demos/Device/ClassDriver/USBtoSerial/Descriptors.c b/Demos/Device/ClassDriver/USBtoSerial/Descriptors.c
index d4db3a4b7..38f5689b5 100644
--- a/Demos/Device/ClassDriver/USBtoSerial/Descriptors.c
+++ b/Demos/Device/ClassDriver/USBtoSerial/Descriptors.c
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
- .SerialNumStrIndex = NO_DESCRIPTOR,
+ .SerialNumStrIndex = USE_INTERNAL_SERIAL,
.NumberOfConfigurations = 1
};