summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-01-16 16:17:05 +0100
committerHiFiPhile <[email protected]>2026-01-16 16:17:05 +0100
commit042ebc04b325f95d593d337317709adc74e7b435 (patch)
tree6d29ed310a79dba0ecb94a5a0330b82523376bf2 /src
parent71ed9d1498e04f99f69fc8c0336ca41ec7a576af (diff)
fix stream write racing
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src')
-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);
}