Remove USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token, split out standard descriptors into seperate USB_Descriptor_* and USB_StdDescriptor_* structures so that both can be used within the one project.

Add guard to the HID Host Class driver SetProtocol command, to ensure that the device supports boot protocol mode before issuing the request.
This commit is contained in:
Dean Camera 2009-09-09 13:17:04 +00:00
parent 524decdeb3
commit b221e7d175
63 changed files with 433 additions and 375 deletions

View file

@ -51,11 +51,7 @@ uint8_t USB_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const Conf
if ((ErrorCode = USB_Host_SendControlRequest(ConfigHeader)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
*ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).TotalConfigurationSize;
#else
*ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).wTotalLength;
#endif
if (*ConfigSizePtr > BufferSize)
return HOST_GETCONFIG_BuffOverflow;