Skip to content

Commit e98e774

Browse files
jfischer-nokartben
authored andcommitted
drivers: udc_rpi_pico: mark endpoint as not busy after transfer canceled
Mark endpoint as not busy after transfer is canceled. Signed-off-by: Johann Fischer <[email protected]>
1 parent f701357 commit e98e774

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/usb/udc/udc_rpi_pico.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ static void write_ep_ctrl_reg(const struct device *dev, const uint8_t ep,
203203
static void rpi_pico_ep_cancel(const struct device *dev, const uint8_t ep)
204204
{
205205
bool abort_handshake_supported = rp2040_chip_version() >= 2;
206+
struct udc_ep_config *ep_cfg = udc_get_ep_cfg(dev, ep);
206207
const struct rpi_pico_config *config = dev->config;
207208
usb_hw_t *base = config->base;
208209
mm_reg_t abort_done_reg = (mm_reg_t)&base->abort_done;
@@ -213,6 +214,7 @@ static void rpi_pico_ep_cancel(const struct device *dev, const uint8_t ep)
213214
buf_ctrl = read_buf_ctrl_reg(dev, ep);
214215
if (!(buf_ctrl & USB_BUF_CTRL_AVAIL)) {
215216
/* The buffer is not used by the controller */
217+
udc_ep_set_busy(ep_cfg, false);
216218
return;
217219
}
218220

@@ -229,6 +231,7 @@ static void rpi_pico_ep_cancel(const struct device *dev, const uint8_t ep)
229231
rpi_pico_bit_clr(abort_reg, ep_mask);
230232
}
231233

234+
udc_ep_set_busy(ep_cfg, false);
232235
LOG_INF("Canceled ep 0x%02x transaction", ep);
233236
}
234237

0 commit comments

Comments
 (0)