house keeping

This commit is contained in:
hathach
2013-09-27 22:38:23 +07:00
parent 26f75d6cac
commit eb1a101667
15 changed files with 96 additions and 183 deletions

View File

@@ -56,14 +56,14 @@
//--------------------------------------------------------------------+
// IMPLEMENTATION
//--------------------------------------------------------------------+
static tusb_error_t wait_for_io_complete(uint8_t usb_addr)
static DRESULT wait_for_io_complete(uint8_t usb_addr)
{
#if TUSB_CFG_OS == TUSB_OS_NONE
while ( tusbh_msc_status(usb_addr) == TUSB_INTERFACE_STATUS_BUSY )
while ( tusbh_msc_is_busy(usb_addr) )
{
// timeout here
}
return tusbh_msc_status(usb_addr) == TUSB_INTERFACE_STATUS_READY ? RES_OK : RES_ERROR;
return tusbh_msc_is_failed(usb_addr) ? RES_ERROR : RES_OK;
#else
#error semaphore instead of blocking
#endif