Set all CDC and MassStorage device mode demos (LowLevel and ClassDriver) to use the...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 30 Jul 2009 11:03:58 +0000 (11:03 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 30 Jul 2009 11:03:58 +0000 (11:03 +0000)
12 files changed:
Demos/Device/ClassDriver/CDC/Descriptors.h
Demos/Device/ClassDriver/DualCDC/Descriptors.h
Demos/Device/ClassDriver/MassStorage/Descriptors.h
Demos/Device/ClassDriver/USBtoSerial/Descriptors.h
Demos/Device/LowLevel/CDC/Descriptors.c
Demos/Device/LowLevel/CDC/Descriptors.h
Demos/Device/LowLevel/DualCDC/Descriptors.c
Demos/Device/LowLevel/DualCDC/Descriptors.h
Demos/Device/LowLevel/MassStorage/Descriptors.c
Demos/Device/LowLevel/MassStorage/Descriptors.h
Demos/Device/LowLevel/USBtoSerial/Descriptors.c
Demos/Device/LowLevel/USBtoSerial/Descriptors.h

index 33ceab9..a764b2b 100644 (file)
 \r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/CDC.h>\r
 \r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/CDC.h>\r
+               \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
 \r
        /* Macros: */\r
                /** Endpoint number of the CDC device-to-host notification IN endpoint. */\r
 \r
        /* Macros: */\r
                /** Endpoint number of the CDC device-to-host notification IN endpoint. */\r
index 49befad..739303e 100644 (file)
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/CDC.h>\r
 \r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/CDC.h>\r
 \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
+\r
        /* Macros: */\r
                /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */\r
                #define CDC1_NOTIFICATION_EPNUM        3\r
        /* Macros: */\r
                /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */\r
                #define CDC1_NOTIFICATION_EPNUM        3\r
index 0fa147b..5cf653a 100644 (file)
 #define _DESCRIPTORS_H_\r
 \r
        /* Includes: */\r
 #define _DESCRIPTORS_H_\r
 \r
        /* Includes: */\r
+               #include <avr/pgmspace.h>\r
+\r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/USB.h>\r
+               #include <LUFA/Drivers/USB/Class/MassStorage.h>\r
 \r
 \r
-               #include <avr/pgmspace.h>\r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
 \r
        /* Macros: */\r
                /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */\r
 \r
        /* Macros: */\r
                /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */\r
index 730acc6..f78f395 100644 (file)
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/CDC.h>\r
 \r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/CDC.h>\r
 \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
+\r
        /* Macros: */\r
                /** Endpoint number of the CDC device-to-host notification IN endpoint. */\r
                #define CDC_NOTIFICATION_EPNUM         2\r
        /* Macros: */\r
                /** Endpoint number of the CDC device-to-host notification IN endpoint. */\r
                #define CDC_NOTIFICATION_EPNUM         2\r
index 03e6882..581c1c4 100644 (file)
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
-       .SerialNumStrIndex      = NO_DESCRIPTOR,\r
+       .SerialNumStrIndex      = USE_INTERNAL_SERIAL,\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
index bf9e7df..a3d101e 100644 (file)
 \r
                #include <avr/pgmspace.h>\r
 \r
 \r
                #include <avr/pgmspace.h>\r
 \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
+               \r
        /* Macros: */\r
                /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a\r
                 *  uniform structure but variable sized data payloads, thus cannot be represented accurately by\r
        /* Macros: */\r
                /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a\r
                 *  uniform structure but variable sized data payloads, thus cannot be represented accurately by\r
index 64aed7d..d3710c1 100644 (file)
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
-       .SerialNumStrIndex      = NO_DESCRIPTOR,\r
+       .SerialNumStrIndex      = USE_INTERNAL_SERIAL,\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
index aa95b8a..781ba5c 100644 (file)
 \r
                #include <avr/pgmspace.h>\r
 \r
 \r
                #include <avr/pgmspace.h>\r
 \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
+               \r
        /* Macros: */\r
                /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a\r
                 *  uniform structure but variable sized data payloads, thus cannot be represented accurately by\r
        /* Macros: */\r
                /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a\r
                 *  uniform structure but variable sized data payloads, thus cannot be represented accurately by\r
index 6c02a6c..13d18a6 100644 (file)
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
-       .SerialNumStrIndex      = 0x03,\r
+       .SerialNumStrIndex      = USE_INTERNAL_SERIAL,\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
@@ -156,20 +156,6 @@ USB_Descriptor_String_t PROGMEM ProductString =
        .UnicodeString          = L"LUFA Mass Storage Demo"\r
 };\r
 \r
        .UnicodeString          = L"LUFA Mass Storage Demo"\r
 };\r
 \r
-/** Serial number descriptor string. This is a Unicode string containing a string of HEX characters at least 12\r
- *  digits in length to uniquely identify a device when concatenated with the device's Vendor and Product IDs. By\r
- *  using the unique serial number string to identify a device, the device drivers do not need to be reinstalled\r
- *  each time the device is inserted into a different USB port on the same system. <b>This should be unique between\r
- *  devices, or conflicts will occur if two devices sharing the same serial number are inserted into the same system\r
- *  at the same time.</b>\r
- */\r
-USB_Descriptor_String_t PROGMEM SerialNumberString =\r
-{\r
-       .Header                 = {.Size = USB_STRING_LEN(12), .Type = DTYPE_String},\r
-               \r
-       .UnicodeString          = L"000000000000"\r
-};\r
-\r
 /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"\r
  *  documentation) by the application code so that the address and size of a requested descriptor can be given\r
  *  to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
 /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"\r
  *  documentation) by the application code so that the address and size of a requested descriptor can be given\r
  *  to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
@@ -209,10 +195,6 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
                                        Address = (void*)&ProductString;\r
                                        Size    = pgm_read_byte(&ProductString.Header.Size);\r
                                        break;\r
                                        Address = (void*)&ProductString;\r
                                        Size    = pgm_read_byte(&ProductString.Header.Size);\r
                                        break;\r
-                               case 0x03: \r
-                                       Address = (void*)&SerialNumberString;\r
-                                       Size    = pgm_read_byte(&SerialNumberString.Header.Size);\r
-                                       break;\r
                        }\r
                        \r
                        break;\r
                        }\r
                        \r
                        break;\r
index 0fa147b..9b9dd7d 100644 (file)
 \r
                #include <avr/pgmspace.h>\r
 \r
 \r
                #include <avr/pgmspace.h>\r
 \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
+\r
        /* Macros: */\r
                /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */\r
                #define MASS_STORAGE_IN_EPNUM          3        \r
        /* Macros: */\r
                /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */\r
                #define MASS_STORAGE_IN_EPNUM          3        \r
index 088ab59..c586d68 100644 (file)
@@ -59,7 +59,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
-       .SerialNumStrIndex      = NO_DESCRIPTOR,\r
+       .SerialNumStrIndex      = USE_INTERNAL_SERIAL,\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
                \r
        .NumberOfConfigurations = 1\r
 };\r
index bf9e7df..a3d101e 100644 (file)
 \r
                #include <avr/pgmspace.h>\r
 \r
 \r
                #include <avr/pgmspace.h>\r
 \r
+               #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+                       #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+               #endif\r
+               \r
        /* Macros: */\r
                /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a\r
                 *  uniform structure but variable sized data payloads, thus cannot be represented accurately by\r
        /* Macros: */\r
                /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a\r
                 *  uniform structure but variable sized data payloads, thus cannot be represented accurately by\r