Skip to content

Commit

Permalink
rp2040 correct dcd_edpt_iso_activate
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Jan 4, 2025
1 parent 2495563 commit 491fe4c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/mcu/st/cmsis_device_f0
Submodule cmsis_device_f0 added at 2fc25e
1 change: 1 addition & 0 deletions hw/mcu/st/cmsis_device_f3
Submodule cmsis_device_f3 added at 5e4ee5
1 change: 1 addition & 0 deletions hw/mcu/st/cmsis_device_g0
Submodule cmsis_device_g0 added at 3a23e1
1 change: 1 addition & 0 deletions lib/FreeRTOS-Kernel
Submodule FreeRTOS-Kernel added at cc0e07
1 change: 1 addition & 0 deletions lib/lwip
Submodule lwip added at 159e31
6 changes: 6 additions & 0 deletions src/portable/raspberrypi/rp2040/dcd_rp2040.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@ bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet
bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc) {
(void) rhport;
const uint8_t ep_addr = ep_desc->bEndpointAddress;

// init w/o allocate
const uint16_t mps = ep_desc->wMaxPacketSize;
uint16_t size = (uint16_t)tu_div_ceil(mps, 64) * 64u;
hw_endpoint_init(ep_addr, size, TUSB_XFER_ISOCHRONOUS);

// Fill in endpoint control register with buffer offset
struct hw_endpoint* ep = hw_endpoint_get_by_addr(ep_addr);
TU_ASSERT(ep->hw_data_buf != NULL); // must be inited and buffer allocated
Expand Down

0 comments on commit 491fe4c

Please sign in to comment.