mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
remove test unit ready with disk_ioctl (cmd=CTRL_SYNC) as it is proved to be not needed
This commit is contained in:
parent
a1978e20fe
commit
e979f22f93
13
vendor/fatfs/diskio.c
vendored
13
vendor/fatfs/diskio.c
vendored
@ -59,7 +59,7 @@ static DSTATUS disk_state[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
//--------------------------------------------------------------------+
|
||||
static DRESULT wait_for_io_complete(uint8_t usb_addr)
|
||||
{
|
||||
#if TUSB_CFG_OS == TUSB_OS_NONE
|
||||
#if TUSB_CFG_OS == TUSB_OS_NONE
|
||||
while ( tusbh_msc_is_busy(usb_addr) )
|
||||
{
|
||||
// timeout here
|
||||
@ -124,21 +124,10 @@ DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, BYTE count)
|
||||
/* [IN] Drive number */
|
||||
/* [IN] Control command code */
|
||||
/* [I/O] Parameter and data buffer */
|
||||
msc_cmd_status_wrapper_t temp_csw TUSB_CFG_ATTR_USBRAM; // TODO MSCH test unit ready refractor
|
||||
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff)
|
||||
{
|
||||
if (cmd != CTRL_SYNC) return RES_ERROR;
|
||||
|
||||
uint8_t usb_addr = pdrv+1;
|
||||
|
||||
do {
|
||||
memclr_(&temp_csw, sizeof(msc_cmd_status_wrapper_t));
|
||||
|
||||
if ( TUSB_ERROR_NONE != tusbh_msc_test_unit_ready(usb_addr, 0, &temp_csw) ) return RES_ERROR;
|
||||
wait_for_io_complete(usb_addr);
|
||||
|
||||
} while( temp_csw.status != 0 ); // wait unitl unit is ready
|
||||
|
||||
return RES_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user