diff options
| author | Zixun LI <[email protected]> | 2025-11-26 11:10:34 +0100 |
|---|---|---|
| committer | Zixun LI <[email protected]> | 2025-11-26 11:10:34 +0100 |
| commit | 37df71cae4c37faaffa1f8a6fc236ec763e4ec03 (patch) | |
| tree | a488ca65990df163e26e078b581fa428c964bbb9 /src/common | |
| parent | a965e1fa4bd92104d68ab20beb1bb56a5019e153 (diff) | |
| parent | 38842491bb55260c0cc7d7709abe5b0e73a0de61 (diff) | |
Merge remote-tracking branch 'tinyusb/master' into hcd_fsdev
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/tusb_fifo.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h index 9d8b864e9..2fb4f37d4 100644 --- a/src/common/tusb_fifo.h +++ b/src/common/tusb_fifo.h @@ -175,7 +175,9 @@ bool tu_fifo_full(const tu_fifo_t *f); bool tu_fifo_overflowed(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; + uint16_t wr_idx = f->wr_idx; + uint16_t rd_idx = f->rd_idx; + return wr_idx == rd_idx; } TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_fifo_depth(const tu_fifo_t *f) { |
