diff options
| author | hathach <[email protected]> | 2014-02-28 16:31:57 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-02-28 16:31:57 +0700 |
| commit | e979f22f93e8bc2c10e06ad10770e9d004846ffa (patch) | |
| tree | 5ac08cfb35adf99d8b21c277d340b2bf8fbf017a | |
| parent | a1978e20fe04ae98cd54cdddd8f98ba288021d43 (diff) | |
remove test unit ready with disk_ioctl (cmd=CTRL_SYNC) as it is proved to be not needed
| -rw-r--r-- | vendor/fatfs/diskio.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/vendor/fatfs/diskio.c b/vendor/fatfs/diskio.c index 70010d849..3ff6dcd2b 100644 --- a/vendor/fatfs/diskio.c +++ b/vendor/fatfs/diskio.c @@ -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; } |
