diff options
-rw-r--r-- | os/hal/include/hal_usbh.h | 6 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 10 | ||||
-rw-r--r-- | os/hal/src/hal_usbh.c | 11 |
3 files changed, 19 insertions, 8 deletions
diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index 7ff8de0..9e31096 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -301,6 +301,12 @@ extern "C" { } /* Synchronous API */ + usbh_urbstatus_t usbhSyncrhonousTransfer(usbh_ep_t *ep, + void *data, + uint32_t len, + uint32_t *actual_len, + systime_t timeout); + usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, void *data, uint32_t len, 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 05054d0..0403eae 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1172,18 +1172,14 @@ static inline void _nptxfe_int(USBHDriver *host) { } static inline void _ptxfe_int(USBHDriver *host) { - // //TODO: implement - // (void)host; - // uinfo("PTXFE"); - uint32_t rem; stm32_otg_t *const otg = host->otg; - rem = _write_packet(&host->ep_active_lists[USBH_EPTYPE_CTRL], - otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK); + rem = _write_packet(&host->ep_active_lists[USBH_EPTYPE_ISO], + otg->HPTXSTS & HPTXSTS_PTXFSAVL_MASK); rem += _write_packet(&host->ep_active_lists[USBH_EPTYPE_INT], - otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK); + otg->HPTXSTS & HPTXSTS_PTXFSAVL_MASK); if (!rem) otg->GINTMSK &= ~GINTMSK_PTXFEM; diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index 10c5c03..a7ceedf 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -335,10 +335,19 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, uint32_t len, uint32_t *actual_len, systime_t timeout) { + osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); + + return usbhSyncrhonousTransfer(ep,data,len,actual_len,timeout); +} + +usbh_urbstatus_t usbhSyncrhonousTransfer(usbh_ep_t *ep, + void *data, + uint32_t len, + uint32_t *actual_len, + systime_t timeout) { osalDbgCheck(ep != NULL); osalDbgCheck((data != NULL) || (len == 0)); - // osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); usbh_urb_t urb; usbhURBObjectInit(&urb, ep, 0, 0, data, len); |