Fixed Pipe_IsEndpointBound() function not taking the endpoint's direction into account.

Re-added Pipe_IsEndpointBound() calls to the CDC and RNDIS host class drivers, not that the function has the correct behaviour for devices with bidirectional endpoints.
This commit is contained in:
Dean Camera 2010-02-01 01:27:00 +00:00
parent bb1a036f09
commit b6a4584a19
9 changed files with 44 additions and 24 deletions

View file

@ -78,8 +78,15 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
{
Pipe_SelectPipe(PNum);
if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))
return true;
uint8_t PipeToken = Pipe_GetPipeToken();
if (PipeToken != PIPE_TOKEN_SETUP)
PipeToken = (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)) && PipeToken)
{
return true;
}
}
Pipe_SelectPipe(PrevPipeNumber);