summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorJames Smith <{ID}+{username}@users.noreply.github.com>2025-12-21 09:06:05 -0700
committerJames Smith <{ID}+{username}@users.noreply.github.com>2025-12-21 09:06:05 -0700
commitb53739dee47ae21a21eaa74e9ae6d17d0def32c8 (patch)
tree2d81828b924cac2502f6a71b4a596a497ff7eacd /src/class
parentb7463bad87456303c0b68bda120a300b343f45fa (diff)
Change return of tud_vendor_n_write_clear from uint32_t to bool
Diffstat (limited to 'src/class')
-rw-r--r--src/class/vendor/vendor_device.c5
-rw-r--r--src/class/vendor/vendor_device.h6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/class/vendor/vendor_device.c b/src/class/vendor/vendor_device.c
index 762cbeebc..b8e6fec6f 100644
--- a/src/class/vendor/vendor_device.c
+++ b/src/class/vendor/vendor_device.c
@@ -161,12 +161,11 @@ uint32_t tud_vendor_n_write_available(uint8_t idx) {
return tu_edpt_stream_write_available(&p_itf->stream.tx);
}
-uint32_t tud_vendor_n_write_clear(uint8_t idx) {
+bool tud_vendor_n_write_clear(uint8_t idx) {
TU_VERIFY(idx < CFG_TUD_VENDOR, 0);
vendord_interface_t *p_itf = &_vendord_itf[idx];
- uint32_t cnt = tu_edpt_stream_read_available(&p_itf->stream.tx);
tu_edpt_stream_clear(&p_itf->stream.tx);
- return cnt;
+ return true;
}
#endif
diff --git a/src/class/vendor/vendor_device.h b/src/class/vendor/vendor_device.h
index 878d7aee0..c3de4c49d 100644
--- a/src/class/vendor/vendor_device.h
+++ b/src/class/vendor/vendor_device.h
@@ -92,8 +92,8 @@ 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);
+// Clear the transmit FIFO
+bool tud_vendor_n_write_clear(uint8_t idx);
#endif
// Write a null-terminated string to TX FIFO
@@ -152,7 +152,7 @@ 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) {
+TU_ATTR_ALWAYS_INLINE static inline bool tud_vendor_write_clear(void) {
return tud_vendor_n_write_clear(0);
}
#endif