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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user