diff options
| author | hathach <[email protected]> | 2021-09-01 16:53:12 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-09-01 16:53:12 +0700 |
| commit | 15fa2f447b9187f2cef5dd5ba904449bd4c6703e (patch) | |
| tree | 0ef422a7513bbe82a8479e79dc07f27c6b34df88 /src | |
| parent | fc889ece74626f49a08898039102f0a9bf2b85a1 (diff) | |
add back edpt check before cbw, since bot reset can occurred any time
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/msc/msc_device.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c index 7dcd4983e..6b3a392a8 100644 --- a/src/class/msc/msc_device.c +++ b/src/class/msc/msc_device.c @@ -323,7 +323,11 @@ bool mscd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t if ( p_msc->stage == MSC_STAGE_CMD ) { // part of reset recovery (probably due to invalid CBW) -> prepare for new command - TU_ASSERT( prepare_cbw(rhport, p_msc) ); + // Note: skip if already queued previously + if ( usbd_edpt_ready(rhport, p_msc->ep_out) ) + { + TU_ASSERT( prepare_cbw(rhport, p_msc) ); + } } } } |
