aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
index 226f1bb..192b008 100644
--- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
@@ -594,9 +594,10 @@ void usbh_lld_ep_open(usbh_ep_t *ep) {
}
void usbh_lld_ep_close(usbh_ep_t *ep) {
- usbh_urb_t *urb, *tmp;
+ usbh_urb_t *urb;
uinfof("\t%s: Closing EP...", ep->name);
- list_for_each_entry_safe(urb, usbh_urb_t, tmp, &ep->urb_list, node) {
+ while (!list_empty(&ep->urb_list)) {
+ urb = list_first_entry(&ep->urb_list, usbh_urb_t, node);
uinfof("\t%s: Abort URB, USBH_URBSTATUS_DISCONNECTED", ep->name);
_usbh_urb_abort_and_waitS(urb, USBH_URBSTATUS_DISCONNECTED);
}
@@ -987,7 +988,7 @@ static inline void _hcint_int(USBHDriver *host) {
haint = host->otg->HAINT;
haint &= host->otg->HAINTMSK;
-#if USBH_LLD_DEBUG_ENABLE_ERRORS
+#if USBH_DEBUG_ENABLE && USBH_LLD_DEBUG_ENABLE_ERRORS
if (!haint) {
uint32_t a, b;
a = host->otg->HAINT;
@@ -1327,7 +1328,7 @@ static void usb_lld_serve_interrupt(USBHDriver *host) {
gintsts &= otg->GINTMSK;
if (!gintsts) {
-#if USBH_DEBUG_ENABLE_WARNINGS
+#if USBH_DEBUG_ENABLE && USBH_DEBUG_ENABLE_WARNINGS
uint32_t a, b;
a = otg->GINTSTS;
b = otg->GINTMSK;
@@ -1504,8 +1505,8 @@ static void _usbh_start(USBHDriver *usbh) {
#endif
{
/* OTG HS clock enable and reset.*/
- rccEnableOTG_HS(TRUE); // Enable HS clock when cpu is in sleep mode
- rccDisableOTG_HSULPI(TRUE); // Disable HS ULPI clock when cpu is in sleep mode
+ rccEnableOTG_HS(FALSE); // Disable HS clock when cpu is in sleep mode
+ rccDisableOTG_HSULPI();
rccResetOTG_HS();
otgp->GINTMSK = 0;