From 126d767a59799ce12ca647d87d6019917f13e4c2 Mon Sep 17 00:00:00 2001 From: cyliang tw Date: Wed, 13 Dec 2023 13:53:27 +0800 Subject: [PATCH] Avoid USBCDC send_nb break the continuation use case --- drivers/usb/source/USBCDC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/source/USBCDC.cpp b/drivers/usb/source/USBCDC.cpp index 827e7536e5a..c42bead6d51 100644 --- a/drivers/usb/source/USBCDC.cpp +++ b/drivers/usb/source/USBCDC.cpp @@ -391,7 +391,7 @@ void USBCDC::send_nb(uint8_t *buffer, uint32_t size, uint32_t *actual, bool now) uint32_t free = sizeof(_tx_buffer) - _tx_size; uint32_t write_size = free > size ? size : free; if (size > 0) { - memcpy(_tx_buf, buffer, write_size); + memcpy(_tx_buf + _tx_size, buffer, write_size); } _tx_size += write_size; *actual = write_size;