summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_host.c
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-03-24 21:09:17 +0100
committerHiFiPhile <[email protected]>2025-03-24 21:09:17 +0100
commit3caff80c8ec5ba06be799d00dd1ff8ac9b58a5bc (patch)
treebe64d4af522196ee43b80510131e0b7ac9c0723a /src/class/cdc/cdc_host.c
parentabfbcf5ccca88017dfb50e237a4981e47057b3a8 (diff)
parentcf76af1056e9a3019d9b08503b783a86602374f0 (diff)
Merge remote-tracking branch 'upstream/master' into h7rs
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/class/cdc/cdc_host.c')
-rw-r--r--src/class/cdc/cdc_host.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c
index e817ebc7e..4058857c5 100644
--- a/src/class/cdc/cdc_host.c
+++ b/src/class/cdc/cdc_host.c
@@ -691,10 +691,10 @@ bool cdch_xfer_cb(uint8_t daddr, uint8_t ep_addr, xfer_result_t event, uint32_t
}
} else if ( ep_addr == p_cdc->stream.rx.ep_addr ) {
#if CFG_TUH_CDC_FTDI
- if (p_cdc->serial_drid == SERIAL_DRIVER_FTDI) {
+ if (p_cdc->serial_drid == SERIAL_DRIVER_FTDI && xferred_bytes > 2) {
// FTDI reserve 2 bytes for status
// uint8_t status[2] = {p_cdc->stream.rx.ep_buf[0], p_cdc->stream.rx.ep_buf[1]};
- tu_edpt_stream_read_xfer_complete_offset(&p_cdc->stream.rx, xferred_bytes, 2);
+ tu_edpt_stream_read_xfer_complete_with_buf(&p_cdc->stream.rx, p_cdc->stream.rx.ep_buf+2, xferred_bytes-2);
}else
#endif
{