aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel/Pipe.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-23 07:55:18 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-23 07:55:18 +0000
commit7f81803aaa312d589f79a77d1426150dcceb29f7 (patch)
treed23f2d3a2e56dfc805bedaf6b17172e4b48f8626 /LUFA/Drivers/USB/LowLevel/Pipe.c
parent189d0c7e669b6a3d07ed35c1eaa0bfc8cbc7a729 (diff)
downloadlufa-7f81803aaa312d589f79a77d1426150dcceb29f7.tar.gz
lufa-7f81803aaa312d589f79a77d1426150dcceb29f7.tar.bz2
lufa-7f81803aaa312d589f79a77d1426150dcceb29f7.zip
Fixed CDCHost demo unfreezing IN pipes during configuration, rather than during use.
Changed Pipe stream functions to automatically set the pipe token, allowing them to be used on bidirectional pipes without having to explicitly call Pipe_SetPipeToken() beforehand.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/Pipe.c')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c
index 189aaa63b..35ba480cd 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -113,6 +113,8 @@ uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
uint8_t* DataStream = (uint8_t*)Data;
uint8_t ErrorCode;
+ Pipe_SetToken(PIPE_TOKEN_OUT);
+
if ((ErrorCode = Pipe_WaitUntilReady()))
return ErrorCode;
@@ -149,6 +151,8 @@ uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
uint8_t* DataStream = (uint8_t*)(Data + Length - 1);
uint8_t ErrorCode;
+ Pipe_SetToken(PIPE_TOKEN_OUT);
+
if ((ErrorCode = Pipe_WaitUntilReady()))
return ErrorCode;
@@ -184,6 +188,8 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
{
uint8_t ErrorCode;
+ Pipe_SetToken(PIPE_TOKEN_IN);
+
if ((ErrorCode = Pipe_WaitUntilReady()))
return ErrorCode;
@@ -220,6 +226,8 @@ uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
uint8_t* DataStream = (uint8_t*)Buffer;
uint8_t ErrorCode;
+ Pipe_SetToken(PIPE_TOKEN_IN);
+
if ((ErrorCode = Pipe_WaitUntilReady()))
return ErrorCode;
@@ -256,6 +264,8 @@ uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
uint8_t* DataStream = (uint8_t*)(Buffer + Length - 1);
uint8_t ErrorCode;
+ Pipe_SetToken(PIPE_TOKEN_IN);
+
if ((ErrorCode = Pipe_WaitUntilReady()))
return ErrorCode;