summaryrefslogtreecommitdiff
path: root/src/class/msc
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-05-28 13:48:02 +0700
committerhathach <[email protected]>2020-05-28 13:48:02 +0700
commit10cd3f24bf0af9b7a1f357505ebbb5ef2132e34b (patch)
tree36c1c14d5d53651ab32bdc0b08e15278da92ed57 /src/class/msc
parentc1db36a15c1e38adc142ec74fd5f3b0320053cc9 (diff)
initial transfer failed in open() shouldn't cause the driver open to fail.
Diffstat (limited to 'src/class/msc')
-rw-r--r--src/class/msc/msc_device.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c
index c3ce495e1..00a5b4525 100644
--- a/src/class/msc/msc_device.c
+++ b/src/class/msc/msc_device.c
@@ -174,7 +174,11 @@ uint16_t mscd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint1
TU_ASSERT( usbd_open_edpt_pair(rhport, tu_desc_next(itf_desc), 2, TUSB_XFER_BULK, &p_msc->ep_out, &p_msc->ep_in), 0 );
// Prepare for Command Block Wrapper
- TU_ASSERT( usbd_edpt_xfer(rhport, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)), 0 );
+ if ( !usbd_edpt_xfer(rhport, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)) )
+ {
+ TU_LOG1_FAILED();
+ TU_BREAKPOINT();
+ }
return _MSC_DRIVER_LEN;
}