Add descriptor class, subclass and protocol constants to the class drivers, modify all demos to use them where possible.

Move out private/internal host class driver constants to the common class driver headers, so that they can be used in the Low Level host mode demos.

Ensure all demos, projects and bootloaders use the class driver constants where possible to minimise code repetition.
This commit is contained in:
Dean Camera 2010-10-25 12:42:55 +00:00
parent b37d77eab3
commit 55538dcef3
96 changed files with 650 additions and 631 deletions

View file

@ -128,9 +128,9 @@ uint8_t DCOMP_SI_Host_NextSIInterface(void* const CurrentDescriptor)
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Interface_t);
if ((CurrentInterface->Class == STILL_IMAGE_CLASS) &&
(CurrentInterface->SubClass == STILL_IMAGE_SUBCLASS) &&
(CurrentInterface->Protocol == STILL_IMAGE_PROTOCOL))
if ((CurrentInterface->Class == SI_CSCP_StillImageClass) &&
(CurrentInterface->SubClass == SI_CSCP_StillImageSubclass) &&
(CurrentInterface->Protocol == SI_CSCP_BulkOnlyProtocol))
{
return DESCRIPTOR_SEARCH_Found;
}
@ -196,7 +196,7 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
PIMA_Container_t* const PIMAHeader)
{
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
uint16_t TimeoutMSRem = SI_COMMAND_DATA_TIMEOUT_MS;
uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber();
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))