/*\r
LUFA Library\r
- Copyright (C) Dean Camera, 2009.\r
+ Copyright (C) Dean Camera, 2010.\r
\r
dean [at] fourwalledcubicle [dot] com\r
www.fourwalledcubicle.com\r
*/\r
\r
/*\r
- Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+ Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
\r
Permission to use, copy, modify, distribute, and sell this \r
software and its documentation for any purpose is hereby granted\r
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)\r
},\r
\r
- .Interface = \r
+ .HID_Interface = \r
{\r
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
\r
.InterfaceStrIndex = NO_DESCRIPTOR\r
},\r
\r
- .HIDDescriptor = \r
+ .HID_VendorHID = \r
{ \r
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},\r
\r
.HIDReportLength = sizeof(HIDReport)\r
},\r
\r
- .HIDEndpoint = \r
+ .HID_ReportINEndpoint = \r
{\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
\r
void* Address = NULL;\r
uint16_t Size = NO_DESCRIPTOR;\r
\r
- switch (DescriptorType)\r
+ /* If/Else If chain compiles slightly smaller than a switch case */\r
+\r
+ if (DescriptorType == DTYPE_Device)\r
+ {\r
+ Address = (void*)&DeviceDescriptor;\r
+ Size = sizeof(USB_Descriptor_Device_t); \r
+ }\r
+ else if (DescriptorType == DTYPE_Device)\r
+ {\r
+ Address = (void*)&ConfigurationDescriptor;\r
+ Size = sizeof(USB_Descriptor_Configuration_t); \r
+ }\r
+ else if (DescriptorType == DTYPE_HID)\r
+ {\r
+ Address = (void*)&ConfigurationDescriptor.HID_VendorHID;\r
+ Size = sizeof(USB_Descriptor_HID_t);\r
+ }\r
+ else\r
{\r
- case DTYPE_Device:\r
- Address = (void*)&DeviceDescriptor;\r
- Size = sizeof(USB_Descriptor_Device_t);\r
- break;\r
- case DTYPE_Configuration:\r
- Address = (void*)&ConfigurationDescriptor;\r
- Size = sizeof(USB_Descriptor_Configuration_t);\r
- break;\r
- case DTYPE_HID:\r
- Address = (void*)&ConfigurationDescriptor.HIDDescriptor;\r
- Size = sizeof(USB_Descriptor_HID_t);\r
- break;\r
- case DTYPE_Report:\r
- Address = (void*)&HIDReport;\r
- Size = sizeof(HIDReport);\r
- break;\r
+ Address = (void*)&HIDReport;\r
+ Size = sizeof(HIDReport);\r
}\r
- \r
+\r
*DescriptorAddress = Address;\r
return Size;\r
}\r