diff options
Diffstat (limited to 'Demos/Device/ClassDriver/MassStorageKeyboard')
-rw-r--r-- | Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c | 10 | ||||
-rw-r--r-- | Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h | 13 |
2 files changed, 17 insertions, 6 deletions
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c index 8a5b5fcdd..2209d5144 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c @@ -73,8 +73,8 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .ProductID = 0x2061, .ReleaseNumber = VERSION_BCD(00.01), - .ManufacturerStrIndex = 0x01, - .ProductStrIndex = 0x02, + .ManufacturerStrIndex = STRING_ID_Manufacturer, + .ProductStrIndex = STRING_ID_Product, .SerialNumStrIndex = USE_INTERNAL_SERIAL, .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS @@ -238,15 +238,15 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, case DTYPE_String: switch (DescriptorNumber) { - case 0x00: + case STRING_ID_Language: Address = &LanguageString; Size = pgm_read_byte(&LanguageString.Header.Size); break; - case 0x01: + case STRING_ID_Manufacturer: Address = &ManufacturerString; Size = pgm_read_byte(&ManufacturerString.Header.Size); break; - case 0x02: + case STRING_ID_Product: Address = &ProductString; Size = pgm_read_byte(&ProductString.Header.Size); break; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h index cd9552c26..2b70e11b4 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h @@ -43,7 +43,7 @@ #include <LUFA/Drivers/USB/USB.h> #include "Config/AppConfig.h" - + /* Macros: */ /** Endpoint address of the Keyboard HID reporting IN endpoint. */ #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1) @@ -80,6 +80,17 @@ USB_Descriptor_Endpoint_t HID_ReportINEndpoint; } USB_Descriptor_Configuration_t; + /** Enum for the device string descriptor IDs within the device. Each string descriptor should + * have a unique ID index associated with it, which can be used to refer to the string from + * other descriptors. + */ + enum StringDescriptors_t + { + STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ + STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ + STRING_ID_Product = 2, /**< Product string ID */ + }; + /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, |