1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #20987 from benpicco/backport/2024.10/stdio-cdc-acm-miss

sys/usb_cdc_acm_stdio: only submit and flush for non-empty buffer [backport 2024.10]
This commit is contained in:
Marian Buschsieweke 2024-11-18 15:34:14 +00:00 committed by GitHub
commit a54faa777b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,13 +37,13 @@ static uint8_t _cdc_tx_buf_mem[CONFIG_USBUS_CDC_ACM_STDIO_BUF_SIZE];
static ssize_t _write(const void* buffer, size_t len)
{
const char *start = buffer;
do {
while (len) {
size_t n = usbus_cdc_acm_submit(&cdcacm, buffer, len);
usbus_cdc_acm_flush(&cdcacm);
/* Use tsrb and flush */
buffer = (char *)buffer + n;
len -= n;
} while (len);
}
return (char *)buffer - start;
}