summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-02-13 15:52:30 +0700
committerhathach <[email protected]>2025-02-13 15:54:31 +0700
commitbad6cbe48930c0c5250b8a717a46cc1f6d83de56 (patch)
tree6cc4d134451896e34d8570e3d682cc92ab5f6cc9 /src/common
parente0b192b633e70338ef5ac88c7f5a49f37867b289 (diff)
update midi host to use endpoint stream API
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_private.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/tusb_private.h b/src/common/tusb_private.h
index c71775abb..445882243 100644
--- a/src/common/tusb_private.h
+++ b/src/common/tusb_private.h
@@ -138,7 +138,7 @@ uint32_t tu_edpt_stream_read(uint8_t hwid, tu_edpt_stream_t* s, void* buffer, ui
// Start an usb transfer if endpoint is not busy
uint32_t tu_edpt_stream_read_xfer(uint8_t hwid, tu_edpt_stream_t* s);
-// Must be called in the transfer complete callback
+// Complete read transfer by writing EP -> FIFO. Must be called in the transfer complete callback
TU_ATTR_ALWAYS_INLINE static inline
void tu_edpt_stream_read_xfer_complete(tu_edpt_stream_t* s, uint32_t xferred_bytes) {
if (tu_fifo_depth(&s->ff)) {
@@ -146,11 +146,11 @@ void tu_edpt_stream_read_xfer_complete(tu_edpt_stream_t* s, uint32_t xferred_byt
}
}
-// Same as tu_edpt_stream_read_xfer_complete but skip the first n bytes
+// Complete read transfer with provided buffer
TU_ATTR_ALWAYS_INLINE static inline
-void tu_edpt_stream_read_xfer_complete_offset(tu_edpt_stream_t* s, uint32_t xferred_bytes, uint32_t skip_offset) {
- if (tu_fifo_depth(&s->ff) && (skip_offset < xferred_bytes)) {
- tu_fifo_write_n(&s->ff, s->ep_buf + skip_offset, (uint16_t) (xferred_bytes - skip_offset));
+void tu_edpt_stream_read_xfer_complete_with_buf(tu_edpt_stream_t* s, const void * buf, uint32_t xferred_bytes) {
+ if (tu_fifo_depth(&s->ff)) {
+ tu_fifo_write_n(&s->ff, buf, (uint16_t) xferred_bytes);
}
}