diff options
author | Diego Ismirlian <dismirlian@gmail.com> | 2019-08-24 17:45:41 -0300 |
---|---|---|
committer | Diego Ismirlian <dismirlian@gmail.com> | 2019-08-24 17:45:41 -0300 |
commit | 7b2c61a676e024163057ec5ccc508a29ab3b9ed4 (patch) | |
tree | 5d1f5423a4e720d657681794ac81dc2a2004cbb0 /os/hal/ports/STM32/LLD/USBHv1 | |
parent | 81391097156ce2c9fc71c3350457522841e10095 (diff) | |
parent | e346e779339636f578536785014609e46866fb9c (diff) | |
download | ChibiOS-Contrib-7b2c61a676e024163057ec5ccc508a29ab3b9ed4.tar.gz ChibiOS-Contrib-7b2c61a676e024163057ec5ccc508a29ab3b9ed4.tar.bz2 ChibiOS-Contrib-7b2c61a676e024163057ec5ccc508a29ab3b9ed4.zip |
Merge branch 'master' of https://github.com/ChibiOS/ChibiOS-Contrib
Diffstat (limited to 'os/hal/ports/STM32/LLD/USBHv1')
-rw-r--r-- | os/hal/ports/STM32/LLD/USBHv1/driver.mk | 9 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 13 |
2 files changed, 16 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/USBHv1/driver.mk b/os/hal/ports/STM32/LLD/USBHv1/driver.mk new file mode 100644 index 0000000..b8f8988 --- /dev/null +++ b/os/hal/ports/STM32/LLD/USBHv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_USBH TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1
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; |