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:
Dean Camera 2009-06-23 07:55:18 +00:00
parent 189d0c7e66
commit 7f81803aaa
6 changed files with 37 additions and 4 deletions

View file

@ -176,10 +176,14 @@ void CDC_Host_Task(void)
case HOST_STATE_Ready:
/* Select and the data IN pipe */
Pipe_SelectPipe(CDC_DATAPIPE_IN);
Pipe_Unfreeze();
/* Check to see if a packet has been received */
if (Pipe_IsINReceived())
{
/* Re-freeze IN pipe after the packet has been received */
Pipe_Freeze();
/* Check if data is in the pipe */
if (Pipe_IsReadWriteAllowed())
{
@ -199,6 +203,9 @@ void CDC_Host_Task(void)
Pipe_ClearIN();
}
/* Re-freeze IN pipe after use */
Pipe_Freeze();
/* Select and unfreeze the notification pipe */
Pipe_SelectPipe(CDC_NOTIFICATIONPIPE);
Pipe_Unfreeze();