Fixed Benito and USBtoSerial projects not turning off the USART before reconfiguring...
[pub/USBasp.git] / Projects / TempDataLogger / Lib / SCSI.c
index 7bb66d3..390441a 100644 (file)
@@ -247,17 +247,12 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte
  *  \param[in] MSInterfaceInfo  Pointer to the Mass Storage class interface structure that the command is associated with
  *  \param[in] IsDataRead  Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
  */
  *  \param[in] MSInterfaceInfo  Pointer to the Mass Storage class interface structure that the command is associated with
  *  \param[in] IsDataRead  Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
  */
-static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead)
+static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
+                                      const bool IsDataRead)
 {
 {
-       uint32_t BlockAddress;
-       uint16_t TotalBlocks;
-       
-       /* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */
-       BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
-
-       /* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */
-       TotalBlocks  = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
-       
+       uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
+       uint16_t TotalBlocks  = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
+               
        /* Check if the block address is outside the maximum allowable value for the LUN */
        if (BlockAddress >= VIRTUAL_MEMORY_BLOCKS)
        {
        /* Check if the block address is outside the maximum allowable value for the LUN */
        if (BlockAddress >= VIRTUAL_MEMORY_BLOCKS)
        {