diff options
| author | Ha Thach <[email protected]> | 2026-06-04 09:16:31 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-06-04 09:16:31 +0700 |
| commit | 35d67a28403fc12970aa39866ff1c24ab41698e6 (patch) | |
| tree | f1d8a03d84ad0d61fb78d86a0838f3154611976b /src/class | |
| parent | f13d86cf298bf653734666b8c364bd8e6eb9f2e5 (diff) | |
| parent | 1f6236ae0788e37bb833e4b018faf10fb691bbdd (diff) | |
Merge pull request #3669 from hathach/dwc2-l476-setup
dwc2: submit SETUP on SETUP_DONE, handle v3.10a spurious RX_COMPLETE (STM32L476)
Diffstat (limited to 'src/class')
| -rw-r--r-- | src/class/mtp/mtp_device.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/class/mtp/mtp_device.c b/src/class/mtp/mtp_device.c index fd06b4601..1f76dfcc7 100644 --- a/src/class/mtp/mtp_device.c +++ b/src/class/mtp/mtp_device.c @@ -443,15 +443,12 @@ bool mtpd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t // Check completion for IN and OUT separately bool is_complete; - - if (is_data_in) - { + if (is_data_in) { // IN completion: short packet, ZLP, or reaching total_len is_complete = (xferred_bytes == 0 || xferred_bytes < threshold || p_mtp->xferred_len >= p_mtp->total_len); - } - else - { - // OUT completion: reaching total_len or ZLP + } else { + // OUT completion: reaching total_len or ZLP only. A short packet does NOT end the phase + // (an early short packet before total_len is the cancel case, not normal completion). is_complete = (p_mtp->xferred_len >= p_mtp->total_len) || ((xferred_bytes == 0 && p_mtp->xferred_len > 0)); } |
