summaryrefslogtreecommitdiff
path: root/src/class/midi
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-02-11 22:04:44 +0100
committerHiFiPhile <[email protected]>2026-02-11 22:04:44 +0100
commit135a130ba51d2e41b30f13fbd998f1db32a47470 (patch)
treefdbd0911fff794c89c014ee7a3a252e92162f8d1 /src/class/midi
parentf5424c569ddc673a9c23b78febceed8f7f098509 (diff)
fix rx transfer length when high speed capable device/host working at full speed
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/class/midi')
-rw-r--r--src/class/midi/midi_device.c8
-rw-r--r--src/class/midi/midi_host.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/class/midi/midi_device.c b/src/class/midi/midi_device.c
index 023a81595..173baf53e 100644
--- a/src/class/midi/midi_device.c
+++ b/src/class/midi/midi_device.c
@@ -324,10 +324,10 @@ void midid_init(void) {
#endif
tu_edpt_stream_init(&p_midi->ep_stream.rx, false, false, false, p_midi->ep_stream.rx_ff_buf,
- CFG_TUD_MIDI_RX_BUFSIZE, epout_buf, CFG_TUD_MIDI_EP_BUFSIZE);
+ CFG_TUD_MIDI_RX_BUFSIZE, epout_buf);
tu_edpt_stream_init(&p_midi->ep_stream.tx, false, true, false, p_midi->ep_stream.tx_ff_buf, CFG_TUD_MIDI_TX_BUFSIZE,
- epin_buf, CFG_TUD_MIDI_EP_BUFSIZE);
+ epin_buf);
}
}
@@ -408,11 +408,11 @@ uint16_t midid_open(uint8_t rhport, const tusb_desc_interface_t *desc_itf, uint1
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
tu_edpt_stream_t *stream_tx = &p_midi->ep_stream.tx;
- tu_edpt_stream_open(stream_tx, rhport, desc_ep);
+ tu_edpt_stream_open(stream_tx, rhport, desc_ep, CFG_TUD_MIDI_EP_BUFSIZE);
tu_edpt_stream_clear(stream_tx);
} else {
tu_edpt_stream_t *stream_rx = &p_midi->ep_stream.rx;
- tu_edpt_stream_open(stream_rx, rhport, desc_ep);
+ tu_edpt_stream_open(stream_rx, rhport, desc_ep, tu_edpt_packet_size(desc_ep));
tu_edpt_stream_clear(stream_rx);
TU_ASSERT(tu_edpt_stream_read_xfer(stream_rx) > 0, 0); // prepare to receive data
}
diff --git a/src/class/midi/midi_host.c b/src/class/midi/midi_host.c
index 5548a0ba8..a3d61a02f 100644
--- a/src/class/midi/midi_host.c
+++ b/src/class/midi/midi_host.c
@@ -121,9 +121,9 @@ bool midih_init(void) {
for (int inst = 0; inst < CFG_TUH_MIDI; inst++) {
midih_interface_t *p_midi_host = &_midi_host[inst];
tu_edpt_stream_init(&p_midi_host->ep_stream.rx, true, false, false,
- p_midi_host->ep_stream.rx_ff_buf, CFG_TUH_MIDI_RX_BUFSIZE, _midi_epbuf->rx, TUH_EPSIZE_BULK_MPS);
+ p_midi_host->ep_stream.rx_ff_buf, CFG_TUH_MIDI_RX_BUFSIZE, _midi_epbuf->rx);
tu_edpt_stream_init(&p_midi_host->ep_stream.tx, true, true, false,
- p_midi_host->ep_stream.tx_ff_buf, CFG_TUH_MIDI_TX_BUFSIZE, _midi_epbuf->tx, TUH_EPSIZE_BULK_MPS);
+ p_midi_host->ep_stream.tx_ff_buf, CFG_TUH_MIDI_TX_BUFSIZE, _midi_epbuf->tx);
}
return true;
}
@@ -306,7 +306,7 @@ uint16_t midih_open(uint8_t rhport, uint8_t dev_addr, const tusb_desc_interface_
ep_stream = &p_midi->ep_stream.rx;
}
TU_ASSERT(tuh_edpt_open(dev_addr, p_ep), 0);
- tu_edpt_stream_open(ep_stream, dev_addr, p_ep);
+ tu_edpt_stream_open(ep_stream, dev_addr, p_ep, p_ep->wMaxPacketSize);
tu_edpt_stream_clear(ep_stream);
break;