We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91c3b33 commit 3f0d266Copy full SHA for 3f0d266
src/common/tusb_fifo.h
@@ -175,7 +175,9 @@ bool tu_fifo_full(const tu_fifo_t *f);
175
bool tu_fifo_overflowed(const tu_fifo_t *f);
176
177
TU_ATTR_ALWAYS_INLINE static inline bool tu_fifo_empty(const tu_fifo_t *f) {
178
- return f->wr_idx == f->rd_idx;
+ uint16_t wr_idx = f->wr_idx;
179
+ uint16_t rd_idx = f->rd_idx;
180
+ return wr_idx == rd_idx;
181
}
182
183
TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_fifo_depth(const tu_fifo_t *f) {
0 commit comments