eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
154 stars 89 forks source link

OHCI_HC_PS_PRSC flag should be cleared in the ux_hCD_hoci_INTERRUPt_handler function #59

Closed zhangjinxing closed 2 years ago

zhangjinxing commented 2 years ago

I found that the OHCI_HC_PS_PRSC flag should be cleared in the ux_hcd_hoci_interrupt_handler function, otherwise the interrupt will continue。

未命名图片

But the following code needs to be modified 未命名图片

CPU:N32905 ARM926

xiaocq2001 commented 2 years ago

How about disable HcInterruptEnable.RHSC when performing port reset, to avoid hanging in interrupts? It does lest change.

Another way with RTOS practice would be adding event flags (or semaphore) and wait events for the status change. In interrupt set event flags (or put semaphore) to wakeup pending thread that is doing reset.

zhangjinxing commented 2 years ago

Thanks!