Skip to content

Commit 7ef4119

Browse files
apply AI suggestions
1 parent aceaebb commit 7ef4119

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/portable/raspberrypi/rp2040/hcd_rp2040.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr) {
607607
*ep_reg = 0;
608608
}
609609

610+
ep->interrupt_num = 0;
610611
ep->max_packet_size = 0; // mark as unused
611612
}
612613
}
@@ -660,6 +661,7 @@ bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, const tusb_desc_endpoint_t
660661
}
661662

662663
if (ep->transfer_type != TUSB_XFER_INTERRUPT) {
664+
ep->interrupt_num = 0;
663665
ep->dpram_buf = usbh_dpram->epx_data;
664666
} else {
665667
// Scan ep_pool (not usb_hw->int_ep_ctrl) to find a free interrupt slot.
@@ -729,6 +731,7 @@ bool hcd_edpt_close(uint8_t rhport, uint8_t daddr, uint8_t ep_addr) {
729731
}
730732
}
731733
rp2usb_reset_transfer(ep);
734+
ep->interrupt_num = 0;
732735
ep->max_packet_size = 0;
733736
rp2usb_critical_exit();
734737
return true;
@@ -737,7 +740,7 @@ bool hcd_edpt_close(uint8_t rhport, uint8_t daddr, uint8_t ep_addr) {
737740
bool hcd_edpt_abort_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) {
738741
(void)rhport;
739742
hw_endpoint_t *ep = edpt_find(dev_addr, ep_addr);
740-
if (!ep) return true;
743+
if (!ep) return false;
741744

742745
rp2usb_critical_enter();
743746

src/portable/raspberrypi/rp2040/rp2040_usb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#if CFG_TUSB_MCU == OPT_MCU_RP2040 && (CFG_TUD_ENABLED || CFG_TUH_ENABLED)
3131

3232
#include <stdlib.h>
33-
#include "rp2040_usb.h"
33+
#include "portable/raspberrypi/rp2040/rp2040_usb.h"
3434

3535
#include "device/dcd.h"
3636
#include "host/hcd.h"
@@ -261,7 +261,6 @@ void rp2usb_xfer_start(hw_endpoint_t *ep, io_rw_32 *ep_reg, io_rw_32 *buf_reg, u
261261
if (ep->remaining_len == 0) {
262262
const uint16_t xferred_len = ep->xferred_len;
263263
rp2usb_reset_transfer(ep);
264-
265264
dcd_event_xfer_complete(0, ep->ep_addr, xferred_len, XFER_RESULT_SUCCESS, false);
266265
hw_endpoint_lock_update(ep, -1);
267266
return;
@@ -280,7 +279,7 @@ void rp2usb_xfer_start(hw_endpoint_t *ep, io_rw_32 *ep_reg, io_rw_32 *buf_reg, u
280279
}
281280
}
282281
#endif // CFG_TUSB_RP2_ERRATA_E15
283-
#endif // CFG_TUD_ENABLED
282+
#endif // CFG_TUD_ENABLED
284283

285284
rp2usb_buffer_start(ep, ep_reg, buf_reg, is_rx);
286285
hw_endpoint_lock_update(ep, -1);

0 commit comments

Comments
 (0)