mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-05 07:05:35 +00:00
Removed tu_fifo_count_and_clear
This commit is contained in:
4
src/class/vendor/vendor_device.c
vendored
4
src/class/vendor/vendor_device.c
vendored
@ -164,7 +164,9 @@ uint32_t tud_vendor_n_write_available(uint8_t idx) {
|
||||
uint32_t tud_vendor_n_write_clear(uint8_t idx) {
|
||||
TU_VERIFY(idx < CFG_TUD_VENDOR, 0);
|
||||
vendord_interface_t *p_itf = &_vendord_itf[idx];
|
||||
return tu_edpt_stream_count_and_clear(&p_itf->stream.tx);
|
||||
uint32_t cnt = tu_edpt_stream_read_available(&p_itf->stream.tx);
|
||||
tu_edpt_stream_clear(&p_itf->stream.tx);
|
||||
return cnt;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -95,22 +95,6 @@ void tu_fifo_clear(tu_fifo_t *f) {
|
||||
ff_unlock(f->mutex_rd);
|
||||
}
|
||||
|
||||
// synchronously count then clear fifo, returning the count
|
||||
uint16_t tu_fifo_count_and_clear(tu_fifo_t *f) {
|
||||
ff_lock(f->mutex_wr);
|
||||
ff_lock(f->mutex_rd);
|
||||
|
||||
uint16_t cnt = tu_fifo_count(f);
|
||||
|
||||
f->rd_idx = 0;
|
||||
f->wr_idx = 0;
|
||||
|
||||
ff_unlock(f->mutex_wr);
|
||||
ff_unlock(f->mutex_rd);
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
// Change the fifo overwritable mode
|
||||
void tu_fifo_set_overwritable(tu_fifo_t *f, bool overwritable) {
|
||||
if (f->overwritable == overwritable) {
|
||||
|
||||
@ -159,7 +159,6 @@ typedef enum {
|
||||
bool tu_fifo_config(tu_fifo_t *f, void *buffer, uint16_t depth, uint16_t item_size, bool overwritable);
|
||||
void tu_fifo_set_overwritable(tu_fifo_t *f, bool overwritable);
|
||||
void tu_fifo_clear(tu_fifo_t *f);
|
||||
uint16_t tu_fifo_count_and_clear(tu_fifo_t *f);
|
||||
|
||||
#if OSAL_MUTEX_REQUIRED
|
||||
TU_ATTR_ALWAYS_INLINE static inline
|
||||
|
||||
@ -144,10 +144,6 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_clear(tu_edpt_stream_t *
|
||||
tu_fifo_clear(&s->ff);
|
||||
}
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_edpt_stream_count_and_clear(tu_edpt_stream_t *s) {
|
||||
return tu_fifo_count_and_clear(&s->ff);
|
||||
}
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE static inline bool tu_edpt_stream_empty(tu_edpt_stream_t *s) {
|
||||
return tu_fifo_empty(&s->ff);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user