diff options
| author | hathach <[email protected]> | 2025-12-10 15:25:30 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-12-10 15:25:30 +0700 |
| commit | a165cf26b269efa396667b05f5ccedace9b528ca (patch) | |
| tree | 01025109094bf8f7f29d44644febe3b78716482b /src/common/tusb_private.h | |
| parent | fcc300770d9df7fdbefc2f899b63ef8fcb274b80 (diff) | |
remove tu_fifo_discard_n() and its usage
Diffstat (limited to 'src/common/tusb_private.h')
| -rw-r--r-- | src/common/tusb_private.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/common/tusb_private.h b/src/common/tusb_private.h index df518d5ff..dc62ae848 100644 --- a/src/common/tusb_private.h +++ b/src/common/tusb_private.h @@ -172,17 +172,15 @@ uint32_t tu_edpt_stream_read_xfer(uint8_t hwid, tu_edpt_stream_t* s); // Complete read transfer by writing EP -> FIFO. Must be called in the transfer complete callback TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_read_xfer_complete(tu_edpt_stream_t* s, uint32_t xferred_bytes) { - if (0u != tu_fifo_depth(&s->ff) && s->ep_buf != NULL) { - tu_fifo_write_n(&s->ff, s->ep_buf, (uint16_t) xferred_bytes); + if (s->ep_buf != NULL) { + tu_fifo_write_n(&s->ff, s->ep_buf, (uint16_t)xferred_bytes); } } // Complete read transfer with provided buffer TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_read_xfer_complete_with_buf(tu_edpt_stream_t *s, const void *buf, uint32_t xferred_bytes) { - if (0u != tu_fifo_depth(&s->ff)) { - tu_fifo_write_n(&s->ff, buf, (uint16_t) xferred_bytes); - } + tu_fifo_write_n(&s->ff, buf, (uint16_t)xferred_bytes); } // Get the number of bytes available for reading @@ -194,10 +192,6 @@ TU_ATTR_ALWAYS_INLINE static inline bool tu_edpt_stream_peek(tu_edpt_stream_t *s return tu_fifo_peek(&s->ff, ch); } -TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_edpt_stream_discard(tu_edpt_stream_t *s, uint32_t len) { - return (uint32_t)tu_fifo_discard_n(&s->ff, (uint16_t)len); -} - #ifdef __cplusplus } #endif |
