static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
{\r
uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);\r
- uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength :\r
- sizeof(InquiryData);\r
+ uint16_t BytesTransferred = MIN(AllocationLength, sizeof(InquiryData));\r
\r
/* Only the standard INQUIRY data is supported, check if any optional INQUIRY bits set */\r
if ((MSInterfaceInfo->State.CommandBlock.SCSICommandData[1] & ((1 << 0) | (1 << 1))) ||\r
static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
{\r
uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];\r
- uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);\r
+ uint8_t BytesTransferred = MIN(AllocationLength, sizeof(SenseData));\r
\r
Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NULL);\r
Endpoint_Null_Stream((AllocationLength - BytesTransferred), NULL);\r
static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
{\r
/* Send an empty header response with the Write Protect flag status */\r
- Endpoint_Write_Byte(0x00);\r
- Endpoint_Write_Byte(0x00);\r
- Endpoint_Write_Byte(DISK_READ_ONLY ? 0x80 : 0x00);\r
- Endpoint_Write_Byte(0x00);\r
+ Endpoint_Write_8(0x00);\r
+ Endpoint_Write_8(0x00);\r
+ Endpoint_Write_8(DISK_READ_ONLY ? 0x80 : 0x00);\r
+ Endpoint_Write_8(0x00);\r
Endpoint_ClearIN();\r
\r
/* Update the bytes transferred counter and succeed the command */\r