Add check to Pipe_IsEndpointBound() in the Mass Storage Host mode Class driver to...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / MassStorage.c
index 1f66aa8..ba281cf 100644 (file)
@@ -113,8 +113,11 @@ static uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)
                uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,\r
                                                        USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);\r
 \r
-               if (EndpointType == EP_TYPE_BULK)\r
-                 return DESCRIPTOR_SEARCH_Found;\r
+               if ((EndpointType == EP_TYPE_BULK) &&\r
+                   (!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress))))\r
+               {\r
+                       return DESCRIPTOR_SEARCH_Found;\r
+               }\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r