diff options
| author | hathach <[email protected]> | 2022-12-10 00:18:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-12-10 00:18:11 +0700 |
| commit | ce064de6fd4416bb5368a2aaff4283f8e4b9fc36 (patch) | |
| tree | 24958b8019aad34710447da3315d7408a9e5767f | |
| parent | 82852774a74631e0916254022339c9713c44cb57 (diff) | |
clean up
| -rw-r--r-- | src/common/tusb_fifo.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c index df07a990c..a3933416c 100644 --- a/src/common/tusb_fifo.c +++ b/src/common/tusb_fifo.c @@ -178,7 +178,8 @@ static void _ff_push_n(tu_fifo_t* f, void const * app_buf, uint16_t n, uint16_t // Write data to linear part of buffer memcpy(ff_buf, app_buf, nLin_bytes); - TU_ASSERT(nWrap_bytes <= f->depth, ); + // Write data wrapped around + // TU_ASSERT(nWrap_bytes <= f->depth, ); memcpy(f->buffer, ((uint8_t const*) app_buf) + nLin_bytes, nWrap_bytes); } break; @@ -504,7 +505,8 @@ static uint16_t _tu_fifo_write_n(tu_fifo_t* f, const void * data, uint16_t n, tu // We start writing at the read pointer's position since we fill the whole buffer wr_idx = rd_idx; - }else if (overflowable_count + n >= 2*f->depth) + } + else if (overflowable_count + n >= 2*f->depth) { // Double overflowed // re-position write index to have a full fifo after pushed |
