summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2026-01-16 18:09:19 +0100
committerGitHub <[email protected]>2026-01-16 18:09:19 +0100
commit6e891c6dc716d6ae91fdc54aaec2899f788e14fc (patch)
tree6d29ed310a79dba0ecb94a5a0330b82523376bf2
parent71ed9d1498e04f99f69fc8c0336ca41ec7a576af (diff)
parent042ebc04b325f95d593d337317709adc74e7b435 (diff)
Merge pull request #3465 from hathach/stream_write_fix
fix stream write racing
-rw-r--r--src/tusb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tusb.c b/src/tusb.c
index bf82cdbe9..6075e9db4 100644
--- a/src/tusb.c
+++ b/src/tusb.c
@@ -392,7 +392,7 @@ uint32_t tu_edpt_stream_write_xfer(tu_edpt_stream_t *s) {
// Pull data from FIFO -> EP buf
uint16_t count;
if (s->ep_buf == NULL) {
- count = ff_count;
+ count = tu_fifo_count(&s->ff); // re-get count since fifo can be changed
} else {
count = tu_fifo_read_n(&s->ff, s->ep_buf, s->ep_bufsize);
}