diff options
| author | Reinhard Panhuber <[email protected]> | 2021-01-17 11:55:33 +0100 |
|---|---|---|
| committer | Reinhard Panhuber <[email protected]> | 2021-01-17 11:55:33 +0100 |
| commit | bdbcb8df394a14ac077e5210772cff91c1f76d25 (patch) | |
| tree | 2b3c68966b5a48e90344188e84c407c800d2b04b /src/common/tusb_fifo.h | |
| parent | 485d8fa77e6a7691db77d92a18a70a834c540734 (diff) | |
Add tu_fifo_read_n_into_other_fifo() to copy into from FIFO into another
Fix overflow in tu_fifo_write_n()
Diffstat (limited to 'src/common/tusb_fifo.h')
| -rw-r--r-- | src/common/tusb_fifo.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h index b965386ab..260bd4227 100644 --- a/src/common/tusb_fifo.h +++ b/src/common/tusb_fifo.h @@ -101,13 +101,15 @@ static inline void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t mutex_hdl) #endif bool tu_fifo_write (tu_fifo_t* f, void const * p_data); -uint16_t tu_fifo_write_n (tu_fifo_t* f, void const * p_data, uint16_t count); +uint16_t tu_fifo_write_n (tu_fifo_t* f, void const * p_data, uint16_t n); bool tu_fifo_read (tu_fifo_t* f, void * p_buffer); -uint16_t tu_fifo_read_n (tu_fifo_t* f, void * p_buffer, uint16_t count); +uint16_t tu_fifo_read_n (tu_fifo_t* f, void * p_buffer, uint16_t n); +uint16_t tu_fifo_read_n_into_other_fifo (tu_fifo_t* f, tu_fifo_t* f_target, uint16_t offset, uint16_t n); bool tu_fifo_peek_at (tu_fifo_t* f, uint16_t pos, void * p_buffer); uint16_t tu_fifo_peek_at_n (tu_fifo_t* f, uint16_t pos, void * p_buffer, uint16_t n); +uint16_t tu_fifo_peek_n_into_other_fifo (tu_fifo_t* f, tu_fifo_t* f_target, uint16_t offset, uint16_t n); uint16_t tu_fifo_count (tu_fifo_t* f); bool tu_fifo_empty (tu_fifo_t* f); |
