aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel/CDCHost
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-25 03:26:57 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-25 03:26:57 +0000
commit8c6c27d88bb40ecf55f369fc4499ec990d2d93d2 (patch)
tree21783dc9715b4cd11b1f8ba0a19f28e562cd1805 /Demos/Host/LowLevel/CDCHost
parentc05c7c7df46a0377db8a72cb32f06aa40153d3e1 (diff)
downloadlufa-8c6c27d88bb40ecf55f369fc4499ec990d2d93d2.tar.gz
lufa-8c6c27d88bb40ecf55f369fc4499ec990d2d93d2.tar.bz2
lufa-8c6c27d88bb40ecf55f369fc4499ec990d2d93d2.zip
Added new RNDISHost Host LowLevel demo. Fixed misnamed Pipe_SetPipeToken() macro for setting a pipe's direction. Fixed CDCHost failing on devices with bidirectional endpoints.
Diffstat (limited to 'Demos/Host/LowLevel/CDCHost')
-rw-r--r--Demos/Host/LowLevel/CDCHost/CDCHost.c3
-rw-r--r--Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c14
2 files changed, 13 insertions, 4 deletions
diff --git a/Demos/Host/LowLevel/CDCHost/CDCHost.c b/Demos/Host/LowLevel/CDCHost/CDCHost.c
index 0b09c5a93..c4322587e 100644
--- a/Demos/Host/LowLevel/CDCHost/CDCHost.c
+++ b/Demos/Host/LowLevel/CDCHost/CDCHost.c
@@ -216,8 +216,9 @@ void CDC_Host_Task(void)
USB_HostState = HOST_STATE_Configured;
break;
case HOST_STATE_Configured:
- /* Select and the data IN pipe */
+ /* Select the data IN pipe */
Pipe_SelectPipe(CDC_DATAPIPE_IN);
+ Pipe_SetPipeToken(PIPE_TOKEN_IN);
Pipe_Unfreeze();
/* Check to see if a packet has been received */
diff --git a/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c b/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c
index e95628462..42636ee56 100644
--- a/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c
@@ -145,6 +145,10 @@ uint8_t ProcessConfigurationDescriptor(void)
/* Check if the endpoint is a bulk IN or bulk OUT endpoint */
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
{
+ /* Kill the configured OUT pipe if the data endpoints are bidirectional */
+ if (Pipe_IsEndpointBound(EndpointData->EndpointAddress))
+ Pipe_DisablePipe();
+
/* Configure the data IN pipe */
Pipe_ConfigurePipe(CDC_DATAPIPE_IN, EP_TYPE_BULK, PIPE_TOKEN_IN,
EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
@@ -154,9 +158,13 @@ uint8_t ProcessConfigurationDescriptor(void)
}
else
{
- /* Configure the data OUT pipe */
- Pipe_ConfigurePipe(CDC_DATAPIPE_OUT, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+ /* Only configure the OUT data pipe if the data endpoints haev not shown to be bidirectional */
+ if (!(Pipe_IsEndpointBound(EndpointData->EndpointAddress)))
+ {
+ /* Configure the data OUT pipe */
+ Pipe_ConfigurePipe(CDC_DATAPIPE_OUT, EP_TYPE_BULK, PIPE_TOKEN_OUT,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);
+ }
/* Set the flag indicating that the data OUT pipe has been found */
FoundEndpoints |= (1 << CDC_DATAPIPE_OUT);