Skip to content

Commit 6e891c6

Browse files
authored
Merge pull request #3465 from hathach/stream_write_fix
fix stream write racing
2 parents 71ed9d1 + 042ebc0 commit 6e891c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tusb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ uint32_t tu_edpt_stream_write_xfer(tu_edpt_stream_t *s) {
392392
// Pull data from FIFO -> EP buf
393393
uint16_t count;
394394
if (s->ep_buf == NULL) {
395-
count = ff_count;
395+
count = tu_fifo_count(&s->ff); // re-get count since fifo can be changed
396396
} else {
397397
count = tu_fifo_read_n(&s->ff, s->ep_buf, s->ep_bufsize);
398398
}

0 commit comments

Comments
 (0)