summaryrefslogtreecommitdiff
path: root/src/class/mtp/mtp_device.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-09-26 10:06:32 +0700
committerhathach <[email protected]>2025-09-26 10:06:32 +0700
commite4f7fcf7ec4239aff6193a8d71cd0e8ce94024dd (patch)
tree4049095bab182700ce49894f068b50d9790dbbaf /src/class/mtp/mtp_device.c
parent34be38db190c9fb8ca5f6c1db8bab33566e397cb (diff)
fix compile warnings
Diffstat (limited to 'src/class/mtp/mtp_device.c')
-rw-r--r--src/class/mtp/mtp_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/class/mtp/mtp_device.c b/src/class/mtp/mtp_device.c
index 6438fd2d6..61b1c9613 100644
--- a/src/class/mtp/mtp_device.c
+++ b/src/class/mtp/mtp_device.c
@@ -267,7 +267,7 @@ static bool mtpd_data_xfer(mtp_container_info_t* p_container, uint8_t ep_addr) {
TU_ASSERT(p_mtp->phase == MTP_PHASE_DATA);
}
- const uint16_t xact_len = tu_min32(p_mtp->total_len - p_mtp->xferred_len, CFG_TUD_MTP_EP_BUFSIZE);
+ const uint16_t xact_len = tu_min16((uint16_t) (p_mtp->total_len - p_mtp->xferred_len), CFG_TUD_MTP_EP_BUFSIZE);
if (xact_len) {
// already transferred all bytes in header's length. Application make an unnecessary extra call
TU_ASSERT(usbd_edpt_xfer(p_mtp->rhport, ep_addr, _mtpd_epbuf.buf, xact_len));
@@ -309,7 +309,7 @@ bool mtpd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
const mtp_container_info_t headered_packet = {
.header = &p_container->header,
- .payload32 = p_container->data,
+ .payload = p_container->payload,
.payload_bytes = CFG_TUD_MTP_EP_BUFSIZE - sizeof(mtp_container_header_t)
};