Skip to content

Commit

Permalink
Merge pull request #20987 from benpicco/backport/2024.10/stdio-cdc-ac…
Browse files Browse the repository at this point in the history
…m-miss

sys/usb_cdc_acm_stdio: only submit and flush for non-empty buffer [backport 2024.10]
  • Loading branch information
maribu authored Nov 18, 2024
2 parents b9432b2 + ed00724 commit a54faa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/usb/usbus/cdc/acm/cdc_acm_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a54faa7

Please sign in to comment.