aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c
index 78c82e8c4..8784bea0c 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -80,14 +80,13 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
Pipe_SelectPipe(PNum);
uint8_t PipeToken = Pipe_GetPipeToken();
+ bool PipeTokenCorrect = true;
if (PipeToken != PIPE_TOKEN_SETUP)
- PipeToken = (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
+ PipeTokenCorrect = (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
- if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)) && PipeToken)
- {
- return true;
- }
+ if (Pipe_IsConfigured() && PipeTokenCorrect && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))
+ return true;
}
Pipe_SelectPipe(PrevPipeNumber);