mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-05 10:15:36 +00:00
Change return of tud_vendor_n_write_clear from uint32_t to bool
This commit is contained in:
5
src/class/vendor/vendor_device.c
vendored
5
src/class/vendor/vendor_device.c
vendored
@ -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
|
||||
|
||||
|
||||
6
src/class/vendor/vendor_device.h
vendored
6
src/class/vendor/vendor_device.h
vendored
@ -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
|
||||
|
||||
Reference in New Issue
Block a user