X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/189d0c7e669b6a3d07ed35c1eaa0bfc8cbc7a729..7f81803aaa312d589f79a77d1426150dcceb29f7:/Demos/Host/LowLevel/CDCHost/CDCHost.c diff --git a/Demos/Host/LowLevel/CDCHost/CDCHost.c b/Demos/Host/LowLevel/CDCHost/CDCHost.c index e00332f9f..b3e067418 100644 --- a/Demos/Host/LowLevel/CDCHost/CDCHost.c +++ b/Demos/Host/LowLevel/CDCHost/CDCHost.c @@ -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();