aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorMark Harris <mharris@technobear.com>2017-09-12 16:55:01 +0200
committerMark Harris <mharris@technobear.com>2017-09-12 16:55:01 +0200
commitd2269527b744e0ab249d38663436613158b0a282 (patch)
tree89c4439e010acfa09e7c4670315130d3648c4278 /os/hal
parent354313f408db8f979cd729a19e80ede3a1c83283 (diff)
downloadChibiOS-Contrib-d2269527b744e0ab249d38663436613158b0a282.tar.gz
ChibiOS-Contrib-d2269527b744e0ab249d38663436613158b0a282.tar.bz2
ChibiOS-Contrib-d2269527b744e0ab249d38663436613158b0a282.zip
implement ptxfe_int for outbound INT ep
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c18
-rw-r--r--os/hal/src/hal_usbh.c2
2 files changed, 16 insertions, 4 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 4723508..05054d0 100644
--- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
@@ -1172,9 +1172,21 @@ static inline void _nptxfe_int(USBHDriver *host) {
}
static inline void _ptxfe_int(USBHDriver *host) {
- //TODO: implement
- (void)host;
- uinfo("PTXFE");
+ // //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_INT],
+ otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK);
+
+ if (!rem)
+ otg->GINTMSK &= ~GINTMSK_PTXFEM;
}
static void _disable(USBHDriver *host) {
diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c
index 7dff98a..10c5c03 100644
--- a/os/hal/src/hal_usbh.c
+++ b/os/hal/src/hal_usbh.c
@@ -338,7 +338,7 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep,
osalDbgCheck(ep != NULL);
osalDbgCheck((data != NULL) || (len == 0));
- osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep");
+ // osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep");
usbh_urb_t urb;
usbhURBObjectInit(&urb, ep, 0, 0, data, len);