Condensed SCSI command functions in the LowLevel Mass Storage Host demo, to save...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / MassStorage.c
index ba281cf..65c49b1 100644 (file)
@@ -110,8 +110,10 @@ static uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
-               uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,\r
-                                                       USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);\r
+               USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,\r
+                                                                             USB_Descriptor_Endpoint_t);\r
+\r
+               uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);\r
 \r
                if ((EndpointType == EP_TYPE_BULK) &&\r
                    (!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress))))\r
@@ -137,7 +139,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, MS_
 {\r
        uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
 \r
-       SCSICommandBlock->Tag = MSInterfaceInfo->State.TransactionTag++;\r
+       SCSICommandBlock->Tag = ++MSInterfaceInfo->State.TransactionTag;\r
 \r
        if (MSInterfaceInfo->State.TransactionTag == 0xFFFFFFFF)\r
          MSInterfaceInfo->State.TransactionTag = 1;\r