Skip to content

Commit

Permalink
Merge pull request #20986 from mguetschow/stdio-cdc-acm-miss
Browse files Browse the repository at this point in the history
sys/usb_cdc_acm_stdio: only submit and flush for non-empty buffer
  • Loading branch information
benpicco authored Nov 14, 2024
2 parents fe62143 + 67edd6c commit 70aa1ec
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 70aa1ec

Please sign in to comment.