Oops - re-order Ringbuffer.h inline functions to prevent compile errors due to forwar...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / MassStorage.c
index e632827..2b7d88e 100644 (file)
@@ -29,7 +29,8 @@
 */
 
 #define  __INCLUDE_FROM_USB_DRIVER
-#include "../../HighLevel/USBMode.h"
+#include "../../Core/USBMode.h"
+
 #if defined(USB_CAN_BE_HOST)
 
 #define  __INCLUDE_FROM_MS_DRIVER
@@ -171,12 +172,12 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
 {
        uint8_t ErrorCode = PIPE_RWSTREAM_NoError;
 
-       SCSICommandBlock->Signature = MS_CBW_SIGNATURE;
-       SCSICommandBlock->Tag       = ++MSInterfaceInfo->State.TransactionTag;
-
-       if (MSInterfaceInfo->State.TransactionTag == 0xFFFFFFFF)
+       if (++MSInterfaceInfo->State.TransactionTag == 0xFFFFFFFF)
          MSInterfaceInfo->State.TransactionTag = 1;
 
+       SCSICommandBlock->Signature = MS_CBW_SIGNATURE;
+       SCSICommandBlock->Tag       = MSInterfaceInfo->State.TransactionTag;
+
        Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
        Pipe_Unfreeze();
 
@@ -360,7 +361,7 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
        if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) != HOST_SENDCONTROL_Successful)
        {
                *MaxLUNIndex = 0;
-               ErrorCode = HOST_SENDCONTROL_Successful;
+               ErrorCode    = HOST_SENDCONTROL_Successful;
        }
 
        return ErrorCode;