summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-06-03 21:46:11 +0700
committerhathach <[email protected]>2026-06-03 21:46:11 +0700
commita6098c38ac3390716a6cf3046a87b13dd85fecca (patch)
tree6afb48a33e2fa3bd7a66c404d2caee5c1845859a /src/class
parent73af6494cd5defc296b91da80e2f59b8af4efa70 (diff)
refactor(cmake): comment out unused target folder properties
Diffstat (limited to 'src/class')
-rw-r--r--src/class/mtp/mtp_device.c11
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));
}