diff options
| author | hathach <[email protected]> | 2021-02-22 12:27:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-02-22 12:27:02 +0700 |
| commit | 43ca6267748e697a70db4c8c085c837addadff2e (patch) | |
| tree | 41acf4593806e2679d0ef2d6d7a0b4fbc89ab962 | |
| parent | 44916bcacf41ec0ec5ae015dd64fec34b9ca4984 (diff) | |
merge iso and cbi transaction size to max ep size
| -rw-r--r-- | src/portable/raspberrypi/rp2040/rp2040_usb.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c index a6e0ed560..339297ad6 100644 --- a/src/portable/raspberrypi/rp2040/rp2040_usb.c +++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c @@ -153,15 +153,7 @@ void _hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, uint16_t t // Fill in info now that we're kicking off the hw ep->total_len = total_len; ep->len = 0; - // FIXME: What if low speed - 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->transfer_size = tu_min32(total_len, ep->wMaxPacketSize); ep->active = true; ep->user_buf = buffer; // Recalculate if this is the last buffer @@ -239,15 +231,7 @@ 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; - - 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); - } + ep->transfer_size = tu_min32(remaining_bytes, ep->wMaxPacketSize); _hw_endpoint_update_last_buf(ep); // Can happen because of programmer error so check for it |
