summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-26 14:03:56 +0700
committerhathach <[email protected]>2025-11-26 14:03:56 +0700
commite1c218f64865b6b0d23f1bf37af22e73ac2c2ee2 (patch)
tree64b5c49f41b6b2ea367cc3747e1cd041483f71a3 /src/common
parent67ba8eab2e346dc13cce3d0813de6370cb3cfa48 (diff)
parent38842491bb55260c0cc7d7709abe5b0e73a0de61 (diff)
Merge branch 'master' into xfer-fifo
# Conflicts: # src/common/tusb_fifo.h
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_fifo.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h
index de32e3cfb..005282824 100644
--- a/src/common/tusb_fifo.h
+++ b/src/common/tusb_fifo.h
@@ -244,7 +244,9 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_fifo_depth(const tu_fifo_t *f) {
}
TU_ATTR_ALWAYS_INLINE static inline bool tu_fifo_empty(const tu_fifo_t *f) {
- return f->wr_idx == f->rd_idx;
+ const uint16_t wr_idx = f->wr_idx;
+ const uint16_t rd_idx = f->rd_idx;
+ return wr_idx == rd_idx;
}
// return number of items in fifo, capped to fifo's depth