diff options
| author | Zhihong Chen <[email protected]> | 2024-02-20 19:53:24 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2024-02-20 22:10:56 +0800 |
| commit | 743669861ed8ec0c199fb65d8c5b81928290621e (patch) | |
| tree | c9927284032b53f04f6568e988c764bd3af6e48a | |
| parent | 0e3e9477cc3ec0baea9339292b16a25ca03a4e9a (diff) | |
port: HPMicro: fix transfer_len not reset
- fix transfer_len not reset
Signed-off-by: Zhihong Chen <[email protected]>
| -rw-r--r-- | port/hpm/usb_dc_hpm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/port/hpm/usb_dc_hpm.c b/port/hpm/usb_dc_hpm.c index 797961e0..ae7fe055 100644 --- a/port/hpm/usb_dc_hpm.c +++ b/port/hpm/usb_dc_hpm.c @@ -1,9 +1,8 @@ #include "usbd_core.h" #include "hpm_usb_device.h" -#include "board.h" #ifndef USB_NUM_BIDIR_ENDPOINTS -#define USB_NUM_BIDIR_ENDPOINTS USB_SOC_DCD_MAX_ENDPOINT_COUNT +#define USB_NUM_BIDIR_ENDPOINTS CONFIG_USBDEV_EP_NUM #endif /* USBSTS, USBINTR */ @@ -241,7 +240,7 @@ void USBD_IRQHandler(uint8_t busid) { uint32_t int_status; usb_device_handle_t *handle = g_hpm_udc[busid].handle; - uint32_t transfer_len = 0; + uint32_t transfer_len; /* Acknowledge handled interrupt */ int_status = usb_device_status_flags(handle); @@ -292,6 +291,8 @@ void USBD_IRQHandler(uint8_t busid) if (edpt_complete) { for (uint8_t ep_idx = 0; ep_idx < USB_SOS_DCD_MAX_QHD_COUNT; ep_idx++) { if (edpt_complete & (1 << ep_idx2bit(ep_idx))) { + transfer_len = 0; + /* Failed QTD also get ENDPTCOMPLETE set */ dcd_qtd_t *p_qtd = usb_device_qtd_get(handle, ep_idx); while (1) { |
