From b53739dee47ae21a21eaa74e9ae6d17d0def32c8 Mon Sep 17 00:00:00 2001 From: James Smith <{ID}+{username}@users.noreply.github.com> Date: Sun, 21 Dec 2025 09:06:05 -0700 Subject: [PATCH] Change return of tud_vendor_n_write_clear from uint32_t to bool --- src/class/vendor/vendor_device.c | 5 ++--- src/class/vendor/vendor_device.h | 6 +++--- 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