complete msc demo with lpc13uxx with readonly flash

This commit is contained in:
hathach
2013-11-26 13:58:13 +07:00
parent 8f70a6a886
commit 47d8af7111
4 changed files with 36 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ static scsi_read_capacity10_data_t mscd_read_capacity10_data TUSB_CFG_ATTR_USBRA
};
ATTR_USB_MIN_ALIGNMENT
static scsi_sense_fixed_data_t mscd_sense_data TUSB_CFG_ATTR_USBRAM =
scsi_sense_fixed_data_t mscd_sense_data TUSB_CFG_ATTR_USBRAM =
{
.response_code = 0x70,
.sense_key = 0, // no errors
@@ -140,6 +140,14 @@ msc_csw_status_t tusbd_msc_scsi_received_isr (uint8_t coreid, uint8_t lun, uint8
default: return MSC_CSW_STATUS_FAILED;
}
//------------- clear sense data if it is not request sense command -------------//
if ( SCSI_CMD_REQUEST_SENSE != scsi_cmd[0] )
{
mscd_sense_data.sense_key = SCSI_SENSEKEY_NONE;
mscd_sense_data.additional_sense_code = 0;
mscd_sense_data.additional_sense_qualifier = 0;
}
return MSC_CSW_STATUS_PASSED;
}