summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-12-10 15:25:30 +0700
committerhathach <[email protected]>2025-12-10 15:25:30 +0700
commita165cf26b269efa396667b05f5ccedace9b528ca (patch)
tree01025109094bf8f7f29d44644febe3b78716482b /src/class
parentfcc300770d9df7fdbefc2f899b63ef8fcb274b80 (diff)
remove tu_fifo_discard_n() and its usage
Diffstat (limited to 'src/class')
-rw-r--r--src/class/vendor/vendor_device.c8
-rw-r--r--src/class/vendor/vendor_device.h7
2 files changed, 2 insertions, 13 deletions
diff --git a/src/class/vendor/vendor_device.c b/src/class/vendor/vendor_device.c
index 62e183465..eb78a13c4 100644
--- a/src/class/vendor/vendor_device.c
+++ b/src/class/vendor/vendor_device.c
@@ -122,12 +122,6 @@ uint32_t tud_vendor_n_read(uint8_t idx, void *buffer, uint32_t bufsize) {
return tu_edpt_stream_read(p_itf->rhport, &p_itf->stream.rx, buffer, bufsize);
}
-uint32_t tud_vendor_n_read_discard(uint8_t idx, uint32_t count) {
- TU_VERIFY(idx < CFG_TUD_VENDOR, 0);
- vendord_interface_t *p_itf = &_vendord_itf[idx];
- return tu_edpt_stream_discard(&p_itf->stream.rx, count);
-}
-
void tud_vendor_n_read_flush(uint8_t idx) {
TU_VERIFY(idx < CFG_TUD_VENDOR, );
vendord_interface_t *p_itf = &_vendord_itf[idx];
@@ -303,8 +297,10 @@ bool vendord_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
vendord_interface_t *p_vendor = &_vendord_itf[idx];
if (ep_addr == p_vendor->stream.rx.ep_addr) {
+ #if CFG_TUD_VENDOR_RX_BUFSIZE
// Received new data: put into stream's fifo
tu_edpt_stream_read_xfer_complete(&p_vendor->stream.rx, xferred_bytes);
+ #endif
// invoke callback
#if CFG_TUD_VENDOR_RX_BUFSIZE == 0
diff --git a/src/class/vendor/vendor_device.h b/src/class/vendor/vendor_device.h
index 764d99070..d59c885d2 100644
--- a/src/class/vendor/vendor_device.h
+++ b/src/class/vendor/vendor_device.h
@@ -73,9 +73,6 @@ bool tud_vendor_n_peek(uint8_t idx, uint8_t *ui8);
// Read from RX FIFO
uint32_t tud_vendor_n_read(uint8_t idx, void *buffer, uint32_t bufsize);
-// Discard count bytes in RX FIFO
-uint32_t tud_vendor_n_read_discard(uint8_t idx, uint32_t count);
-
// Flush (clear) RX FIFO
void tud_vendor_n_read_flush(uint8_t idx);
#endif
@@ -124,10 +121,6 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t tud_vendor_read(void *buffer, uint3
return tud_vendor_n_read(0, buffer, bufsize);
}
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tud_vendor_read_discard(uint32_t count) {
- return tud_vendor_n_read_discard(0, count);
-}
-
TU_ATTR_ALWAYS_INLINE static inline void tud_vendor_read_flush(void) {
tud_vendor_n_read_flush(0);
}