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:
parent
524decdeb3
commit
b221e7d175
63 changed files with 433 additions and 375 deletions
|
@ -50,12 +50,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint16_
|
|||
return MS_ENUMERROR_NoMSInterfaceFound;
|
||||
}
|
||||
|
||||
MSInterfaceInfo->State.InterfaceNumber =
|
||||
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
|
||||
DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->InterfaceNumber;
|
||||
#else
|
||||
DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->bInterfaceNumber;
|
||||
#endif
|
||||
MSInterfaceInfo->State.InterfaceNumber = DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->InterfaceNumber;
|
||||
|
||||
while (FoundEndpoints != (MS_FOUND_DATAPIPE_IN | MS_FOUND_DATAPIPE_OUT))
|
||||
{
|
||||
|
@ -150,7 +145,8 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, MS_
|
|||
Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
|
||||
Pipe_Unfreeze();
|
||||
|
||||
if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t))) != PIPE_RWSTREAM_NoError)
|
||||
if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t),
|
||||
NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
|
||||
return ErrorCode;
|
||||
|
||||
Pipe_ClearOUT();
|
||||
|
@ -238,7 +234,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo,
|
|||
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
|
||||
Pipe_Unfreeze();
|
||||
|
||||
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError)
|
||||
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
|
||||
return ErrorCode;
|
||||
|
||||
Pipe_ClearIN();
|
||||
|
@ -248,7 +244,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo,
|
|||
Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
|
||||
Pipe_Unfreeze();
|
||||
|
||||
if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError)
|
||||
if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
|
||||
return ErrorCode;
|
||||
|
||||
Pipe_ClearOUT();
|
||||
|
@ -276,7 +272,8 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* MSInterfaceInf
|
|||
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
|
||||
Pipe_Unfreeze();
|
||||
|
||||
if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t))) != PIPE_RWSTREAM_NoError)
|
||||
if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t),
|
||||
NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
|
||||
return ErrorCode;
|
||||
|
||||
Pipe_ClearIN();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue