diff --git a/Demos/Device/ClassDriver/CDC/Descriptors.h b/Demos/Device/ClassDriver/CDC/Descriptors.h index 33ceab9c5ac4298176f531ae60d509e002cb790b..a764b2b32494c8643953f00939b00ab670657ddf 100644 --- a/Demos/Device/ClassDriver/CDC/Descriptors.h +++ b/Demos/Device/ClassDriver/CDC/Descriptors.h @@ -41,6 +41,10 @@ #include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/Class/CDC.h> + + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif /* Macros: */ /** Endpoint number of the CDC device-to-host notification IN endpoint. */ diff --git a/Demos/Device/ClassDriver/DualCDC/Descriptors.h b/Demos/Device/ClassDriver/DualCDC/Descriptors.h index 49befad38943f6ea623f1cd8a6a27ae04b8ca44e..739303edda6ab293fc3bc1395727669dcd9cd13f 100644 --- a/Demos/Device/ClassDriver/DualCDC/Descriptors.h +++ b/Demos/Device/ClassDriver/DualCDC/Descriptors.h @@ -42,6 +42,10 @@ #include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/Class/CDC.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif + /* Macros: */ /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */ #define CDC1_NOTIFICATION_EPNUM 3 diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.h b/Demos/Device/ClassDriver/MassStorage/Descriptors.h index 0fa147b75c20f958a2367c4b7622958ac5498579..5cf653a5624778b75d5f13063a8ca7fb74ba19f3 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.h @@ -37,9 +37,14 @@ #define _DESCRIPTORS_H_ /* Includes: */ + #include <avr/pgmspace.h> + #include <LUFA/Drivers/USB/USB.h> + #include <LUFA/Drivers/USB/Class/MassStorage.h> - #include <avr/pgmspace.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif /* Macros: */ /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ diff --git a/Demos/Device/ClassDriver/USBtoSerial/Descriptors.h b/Demos/Device/ClassDriver/USBtoSerial/Descriptors.h index 730acc6014d31e3c671e2df524fa0e5d36102464..f78f395a3be8e06d38dbf332e780c1d00de1142b 100644 --- a/Demos/Device/ClassDriver/USBtoSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/USBtoSerial/Descriptors.h @@ -42,6 +42,10 @@ #include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/Class/CDC.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif + /* Macros: */ /** Endpoint number of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPNUM 2 diff --git a/Demos/Device/LowLevel/CDC/Descriptors.c b/Demos/Device/LowLevel/CDC/Descriptors.c index 03e68827773d760ce0ed3f71f5c11c9d2d13f8b6..581c1c407f2764a90f213e90f436b6596bfbdea0 100644 --- a/Demos/Device/LowLevel/CDC/Descriptors.c +++ b/Demos/Device/LowLevel/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/LowLevel/CDC/Descriptors.h b/Demos/Device/LowLevel/CDC/Descriptors.h index bf9e7df1da5bd87651bc6c37899a7918ec0fd8cb..a3d101e8bbcd29debf8edbf239ac4377480cd33b 100644 --- a/Demos/Device/LowLevel/CDC/Descriptors.h +++ b/Demos/Device/LowLevel/CDC/Descriptors.h @@ -41,6 +41,10 @@ #include <avr/pgmspace.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif + /* Macros: */ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a * uniform structure but variable sized data payloads, thus cannot be represented accurately by diff --git a/Demos/Device/LowLevel/DualCDC/Descriptors.c b/Demos/Device/LowLevel/DualCDC/Descriptors.c index 64aed7d5f07990d368c89676a5758b22b607674f..d3710c1b489d1814f36a55eb0c68d78972055f16 100644 --- a/Demos/Device/LowLevel/DualCDC/Descriptors.c +++ b/Demos/Device/LowLevel/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/LowLevel/DualCDC/Descriptors.h b/Demos/Device/LowLevel/DualCDC/Descriptors.h index aa95b8a4c01e862c17965b141c44390fd50db9bc..781ba5c3192ab9833674cef939a5c409699ed273 100644 --- a/Demos/Device/LowLevel/DualCDC/Descriptors.h +++ b/Demos/Device/LowLevel/DualCDC/Descriptors.h @@ -41,6 +41,10 @@ #include <avr/pgmspace.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif + /* Macros: */ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a * uniform structure but variable sized data payloads, thus cannot be represented accurately by diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.c b/Demos/Device/LowLevel/MassStorage/Descriptors.c index 6c02a6c552724996ea3f45f77bec7d948f545da7..13d18a69d127a82b619defe8af41b19f99ea4eb2 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.c +++ b/Demos/Device/LowLevel/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/LowLevel/MassStorage/Descriptors.h b/Demos/Device/LowLevel/MassStorage/Descriptors.h index 0fa147b75c20f958a2367c4b7622958ac5498579..9b9dd7d318f83265ae180f0ae3b8cd3b0a5d42ec 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.h +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h @@ -41,6 +41,10 @@ #include <avr/pgmspace.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif + /* Macros: */ /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ #define MASS_STORAGE_IN_EPNUM 3 diff --git a/Demos/Device/LowLevel/USBtoSerial/Descriptors.c b/Demos/Device/LowLevel/USBtoSerial/Descriptors.c index 088ab59404667373be4a89c6b3b9d2074d2cf958..c586d68ccb6f7b2acd2dac02569817763b0bb060 100644 --- a/Demos/Device/LowLevel/USBtoSerial/Descriptors.c +++ b/Demos/Device/LowLevel/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 }; diff --git a/Demos/Device/LowLevel/USBtoSerial/Descriptors.h b/Demos/Device/LowLevel/USBtoSerial/Descriptors.h index bf9e7df1da5bd87651bc6c37899a7918ec0fd8cb..a3d101e8bbcd29debf8edbf239ac4377480cd33b 100644 --- a/Demos/Device/LowLevel/USBtoSerial/Descriptors.h +++ b/Demos/Device/LowLevel/USBtoSerial/Descriptors.h @@ -41,6 +41,10 @@ #include <avr/pgmspace.h> + #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. + #endif + /* Macros: */ /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a * uniform structure but variable sized data payloads, thus cannot be represented accurately by