Skip to content

Commit b91d5eb

Browse files
pschatzmannHiFiPhile
authored andcommitted
rp2040 correct dcd_edpt_iso_activate
1 parent 2495563 commit b91d5eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/portable/raspberrypi/rp2040/dcd_rp2040.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,12 @@ bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet
496496
bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc) {
497497
(void) rhport;
498498
const uint8_t ep_addr = ep_desc->bEndpointAddress;
499+
500+
// init w/o allocate
501+
const uint16_t mps = ep_desc->wMaxPacketSize;
502+
uint16_t size = (uint16_t)tu_div_ceil(mps, 64) * 64u;
503+
hw_endpoint_init(ep_addr, size, TUSB_XFER_ISOCHRONOUS);
504+
499505
// Fill in endpoint control register with buffer offset
500506
struct hw_endpoint* ep = hw_endpoint_get_by_addr(ep_addr);
501507
TU_ASSERT(ep->hw_data_buf != NULL); // must be inited and buffer allocated

0 commit comments

Comments
 (0)