diff options
| author | Dean Camera <dean@fourwalledcubicle.com> | 2013-10-06 13:22:23 -0700 |
|---|---|---|
| committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-10-06 13:22:23 -0700 |
| commit | 7ce4d35c3909e0b55d0a184c3d9b2b8cb35b0131 (patch) | |
| tree | 3abbab4d1860ea31d30d7a72496fc9959fecb858 /Projects/Webserver | |
| parent | 8e2476a125d6a4bd0385eb0f9569ac597bdbf9ed (diff) | |
| parent | 9ef29ea2293dde7225360fe258224d22d3a68756 (diff) | |
| download | lufa-7ce4d35c3909e0b55d0a184c3d9b2b8cb35b0131.tar.gz lufa-7ce4d35c3909e0b55d0a184c3d9b2b8cb35b0131.tar.bz2 lufa-7ce4d35c3909e0b55d0a184c3d9b2b8cb35b0131.zip | |
Merge pull request #8 from mondalaci/extract-interface-numbers
Extract interface numbers into enums.
Diffstat (limited to 'Projects/Webserver')
| -rw-r--r-- | Projects/Webserver/Descriptors.c | 6 | ||||
| -rw-r--r-- | Projects/Webserver/Descriptors.h | 17 | ||||
| -rw-r--r-- | Projects/Webserver/USBDeviceMode.c | 4 |
3 files changed, 19 insertions, 8 deletions
diff --git a/Projects/Webserver/Descriptors.c b/Projects/Webserver/Descriptors.c index 8fcba5cc8..b8acf42a2 100644 --- a/Projects/Webserver/Descriptors.c +++ b/Projects/Webserver/Descriptors.c @@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 0, + .InterfaceNumber = INTERFACE_ID_CDC_CCI, .AlternateSetting = 0, .TotalEndpoints = 1, @@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 1, + .InterfaceNumber = INTERFACE_ID_CDC_DCI, .AlternateSetting = 0, .TotalEndpoints = 2, @@ -192,7 +192,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 2, + .InterfaceNumber = INTERFACE_ID_MassStorage, .AlternateSetting = 0, .TotalEndpoints = 2, diff --git a/Projects/Webserver/Descriptors.h b/Projects/Webserver/Descriptors.h index 2c25512e4..c649cf56f 100644 --- a/Projects/Webserver/Descriptors.h +++ b/Projects/Webserver/Descriptors.h @@ -96,15 +96,26 @@ USB_Descriptor_Endpoint_t MS_DataOutEndpoint; } USB_Descriptor_Configuration_t; + /** Enum for the device interface descriptor IDs within the device. Each interface descriptor + * should have a unique ID index associated with it, which can be used to refer to the + * interface from other descriptors. + */ + enum InterfaceDescriptors_t + { + INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */ + INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */ + INTERFACE_ID_MassStorage = 2, /**< Mass storage interface descriptor ID */ + }; + /** 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 */ + 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: */ diff --git a/Projects/Webserver/USBDeviceMode.c b/Projects/Webserver/USBDeviceMode.c index 7d5beb93a..f889b6be6 100644 --- a/Projects/Webserver/USBDeviceMode.c +++ b/Projects/Webserver/USBDeviceMode.c @@ -44,7 +44,7 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface_Device = { .Config = { - .ControlInterfaceNumber = 0, + .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI, .DataINEndpoint = { .Address = CDC_TX_EPADDR, @@ -76,7 +76,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface = { .Config = { - .InterfaceNumber = 2, + .InterfaceNumber = INTERFACE_ID_MassStorage, .DataINEndpoint = { .Address = MASS_STORAGE_IN_EPADDR, |
