diff options
Diffstat (limited to 'Demos')
-rw-r--r-- | Demos/Host/LowLevel/CDCHost/CDCHost.c | 7 | ||||
-rw-r--r-- | Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c | 3 |
2 files changed, 7 insertions, 3 deletions
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();
diff --git a/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c b/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c index 57d7ec051..33234e4fd 100644 --- a/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c @@ -155,7 +155,6 @@ uint8_t ProcessConfigurationDescriptor(void) EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
Pipe_SetInfiniteINRequests();
- Pipe_Unfreeze();
/* Set the flag indicating that the data IN pipe has been found */
FoundEndpoints |= (1 << CDC_DATAPIPE_IN);
@@ -166,8 +165,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(CDC_DATAPIPE_OUT, EP_TYPE_BULK, PIPE_TOKEN_OUT,
EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
- Pipe_Unfreeze();
-
/* Set the flag indicating that the data OUT pipe has been found */
FoundEndpoints |= (1 << CDC_DATAPIPE_OUT);
}
|