diff options
author | Dean Camera <[email protected]> | 2010-02-01 01:27:00 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2010-02-01 01:27:00 +0000 |
commit | b6a4584a19e81c2e1f909355bbc64c2b8cea84f6 (patch) | |
tree | 3e5388a85cea77702c24478245097138c7bf704c /LUFA/Drivers/USB/LowLevel/Pipe.c | |
parent | bb1a036f097602a70ce219915db28dea616b76a8 (diff) | |
download | qmk_firmware-b6a4584a19e81c2e1f909355bbc64c2b8cea84f6.tar.gz qmk_firmware-b6a4584a19e81c2e1f909355bbc64c2b8cea84f6.zip |
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.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/Pipe.c')
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Pipe.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index e88aa63fcd..2b956a8da0 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.c +++ b/LUFA/Drivers/USB/LowLevel/Pipe.c @@ -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);
|