Skip to content

Commit a0982cd

Browse files
authored
Merge pull request #3471 from hathach/msc_stall
device/msc: skip command stage if EP out is stalled
2 parents 2883403 + 30802a1 commit a0982cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/class/msc/msc_device.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,11 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
646646
break;
647647
}
648648

649-
TU_ASSERT(prepare_cbw(p_msc));
649+
if (!usbd_edpt_stalled(rhport, p_msc->ep_out)) {
650+
TU_ASSERT(prepare_cbw(p_msc));
651+
} else {
652+
p_msc->stage = MSC_STAGE_CMD;
653+
}
650654
} else {
651655
// Any xfer ended here is considered unknown error, ignore it
652656
TU_LOG1(" Warning expect SCSI Status but received unknown data\r\n");

0 commit comments

Comments
 (0)