The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0), so that other control type pipes can be used with the function.
The USB Host management task now saves and restores the currently selected pipe before and after the task completes.
This commit is contained in:
parent
fea5d08512
commit
6a5a37d7d1
18 changed files with 69 additions and 2 deletions
|
|
@ -196,6 +196,9 @@ TASK(USB_CDC_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -262,6 +262,9 @@ void WriteNextReport(uint8_t* ReportOUTData, uint16_t ReportLength)
|
|||
wLength: ReportLength,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request to the device */
|
||||
USB_Host_SendControlRequest(ReportOUTData);
|
||||
}
|
||||
|
|
@ -288,6 +291,9 @@ TASK(USB_HID_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -263,6 +263,9 @@ TASK(USB_Keyboard_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
@ -310,6 +313,9 @@ TASK(USB_Keyboard_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ uint8_t GetHIDReportData(void)
|
|||
wLength: HIDReportSize,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send control request to retrieve the HID report from the attached device */
|
||||
if (USB_Host_SendControlRequest(HIDReportData) != HOST_SENDCONTROL_Successful)
|
||||
return ParseControlError;
|
||||
|
|
|
|||
|
|
@ -199,6 +199,9 @@ TASK(USB_Keyboard_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -170,6 +170,9 @@ TASK(USB_MassStore_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -256,6 +256,9 @@ uint8_t MassStore_ClearPipeStall(const uint8_t EndpointNum)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
return USB_Host_SendControlRequest(NULL);
|
||||
}
|
||||
|
||||
|
|
@ -275,6 +278,9 @@ uint8_t MassStore_MassStorageReset(void)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
return USB_Host_SendControlRequest(NULL);
|
||||
}
|
||||
|
||||
|
|
@ -298,6 +304,9 @@ uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex)
|
|||
wLength: 1,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) == HOST_SENDCONTROL_SetupStalled)
|
||||
{
|
||||
/* Clear the pipe stall */
|
||||
|
|
|
|||
|
|
@ -259,6 +259,9 @@ TASK(USB_Mouse_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
@ -306,6 +309,9 @@ TASK(USB_Mouse_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ uint8_t GetHIDReportData(void)
|
|||
wLength: HIDReportSize,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send control request to retrieve the HID report from the attached device */
|
||||
if (USB_Host_SendControlRequest(HIDReportData) != HOST_SENDCONTROL_Successful)
|
||||
return ParseControlError;
|
||||
|
|
|
|||
|
|
@ -200,6 +200,9 @@ TASK(USB_Mouse_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -272,5 +272,8 @@ uint8_t SImage_ClearPipeStall(const uint8_t PipeEndpointNum)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
return USB_Host_SendControlRequest(NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,6 +165,9 @@ TASK(USB_SImage_Host)
|
|||
wLength: 0,
|
||||
};
|
||||
|
||||
/* Select the control pipe for the request transfer */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
/* Send the request, display error and wait for device detach if request fails */
|
||||
if (USB_Host_SendControlRequest(NULL) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue