X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b5ca3990c2ec9dc240fb334002ed2f7c82eea853..23f3c3deee8bd153d59f2ac4e659c71ee75915f7:/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();