summaryrefslogtreecommitdiff
path: root/src/class/vendor/vendor_device.h
diff options
context:
space:
mode:
authorJames Smith <{ID}+{username}@users.noreply.github.com>2025-12-20 13:27:29 -0700
committerJames Smith <{ID}+{username}@users.noreply.github.com>2025-12-20 13:36:54 -0700
commit185757ed413fc7bdc65cf494a6079cfed049f98e (patch)
tree294b6d253af8904322f1dedbb3fb3da7cd114155 /src/class/vendor/vendor_device.h
parent83fa3bbffe2237303ff1ae92fe0b6c8384073993 (diff)
Added tud_vendor_write_clear() which forcefully clears TX buffer
Diffstat (limited to 'src/class/vendor/vendor_device.h')
-rw-r--r--src/class/vendor/vendor_device.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/class/vendor/vendor_device.h b/src/class/vendor/vendor_device.h
index d59c885d2..878d7aee0 100644
--- a/src/class/vendor/vendor_device.h
+++ b/src/class/vendor/vendor_device.h
@@ -91,6 +91,9 @@ uint32_t tud_vendor_n_write_flush(uint8_t idx);
// Return number of bytes available for writing in TX FIFO
uint32_t tud_vendor_n_write_available(uint8_t idx);
+
+// Clear the write buffer and return the number of elements cleared
+uint32_t tud_vendor_n_write_clear(uint8_t idx);
#endif
// Write a null-terminated string to TX FIFO
@@ -148,6 +151,10 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t tud_vendor_write_flush(void) {
TU_ATTR_ALWAYS_INLINE static inline uint32_t tud_vendor_write_available(void) {
return tud_vendor_n_write_available(0);
}
+
+TU_ATTR_ALWAYS_INLINE static inline uint32_t tud_vendor_write_clear(void) {
+ return tud_vendor_n_write_clear(0);
+}
#endif
// backward compatible