summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-02-22 12:21:52 +0700
committerhathach <[email protected]>2021-02-22 12:21:52 +0700
commit44916bcacf41ec0ec5ae015dd64fec34b9ca4984 (patch)
tree2bb81f3e9d93b4d0b8a9d85606127fe59fe11cee /src
parent30085592d4fa46c3ffa749d6a6dc0092e9a6f449 (diff)
parentcb5b9eb2f671a6d1a00205e0df01b0d68725ec60 (diff)
Merge branch 'RP2040_enable_isochronous_buffer_size' of https://github.com/ndinsmore/tinyusb into ndinsmore-RP2040_enable_isochronous_buffer_size
Diffstat (limited to 'src')
-rw-r--r--src/portable/raspberrypi/rp2040/rp2040_usb.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c
index 5c536e314..a6e0ed560 100644
--- a/src/portable/raspberrypi/rp2040/rp2040_usb.c
+++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c
@@ -154,7 +154,14 @@ void _hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, uint16_t t
ep->total_len = total_len;
ep->len = 0;
// FIXME: What if low speed
- ep->transfer_size = total_len > 64 ? 64 : total_len;
+ if(ep->transfer_type == TUSB_XFER_ISOCHRONOUS)
+ {
+ ep->transfer_size = tu_min32(total_len, ep->wMaxPacketSize);
+ }
+ else
+ {
+ ep->transfer_size = tu_min32(total_len, 64);
+ }
ep->active = true;
ep->user_buf = buffer;
// Recalculate if this is the last buffer
@@ -232,7 +239,15 @@ bool _hw_endpoint_xfer_continue(struct hw_endpoint *ep)
// Now we have synced our state with the hardware. Is there more data to transfer?
uint remaining_bytes = ep->total_len - ep->len;
- ep->transfer_size = remaining_bytes > 64 ? 64 : remaining_bytes;
+
+ if(ep->transfer_type == TUSB_XFER_ISOCHRONOUS)
+ {
+ ep->transfer_size = tu_min32(remaining_bytes,ep->wMaxPacketSize);
+ }
+ else
+ {
+ ep->transfer_size = tu_min32(remaining_bytes, 64);
+ }
_hw_endpoint_update_last_buf(ep);
// Can happen because of programmer error so check for it