diff options
author | Fabien Poussin <fabien.poussin@gmail.com> | 2019-10-02 17:56:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 17:56:41 +0200 |
commit | 472ee3ce3c8e4e1267cf00611aab54597dda7121 (patch) | |
tree | 6d532237d92366fc10441e1770ddd74e7924b4a4 /os/hal/src/hal_usbh.c | |
parent | 51910c3551c2a4232ba3defcef063e2f745f925a (diff) | |
parent | 2cd41f99df0fc857afaef091ca3b984a728d0e3c (diff) | |
download | ChibiOS-Contrib-472ee3ce3c8e4e1267cf00611aab54597dda7121.tar.gz ChibiOS-Contrib-472ee3ce3c8e4e1267cf00611aab54597dda7121.tar.bz2 ChibiOS-Contrib-472ee3ce3c8e4e1267cf00611aab54597dda7121.zip |
Merge pull request #196 from dismirlian/master
USBH updates
Diffstat (limited to 'os/hal/src/hal_usbh.c')
-rw-r--r-- | os/hal/src/hal_usbh.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index 7dff98a..feaf956 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -302,6 +302,7 @@ msg_t usbhURBSubmitAndWaitS(usbh_urb_t *urb, systime_t timeout) { _check_urb(urb); usbhURBSubmitI(urb); + osalOsRescheduleS(); /* This call is necessary because usbhURBSubmitI may require a reschedule */ ret = usbhURBWaitTimeoutS(urb, timeout); if (ret == MSG_TIMEOUT) _usbh_urb_abort_and_waitS(urb, USBH_URBSTATUS_TIMEOUT); @@ -330,7 +331,7 @@ void _usbh_urb_completeI(usbh_urb_t *urb, usbh_urbstatus_t status) { /* Synchronous API. */ /*===========================================================================*/ -usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, +usbh_urbstatus_t usbhSynchronousTransfer(usbh_ep_t *ep, void *data, uint32_t len, uint32_t *actual_len, @@ -338,7 +339,6 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, 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); @@ -860,9 +860,7 @@ static void _port_process_status_change(usbh_port_t *port) { usbhhubClearFeaturePort(port, USBH_PORT_FEAT_C_CONNECTION); if (port->device.status != USBH_DEVSTATUS_DISCONNECTED) { - if (!(port->status & USBH_PORTSTATUS_CONNECTION)) { - _usbh_port_disconnected(port); - } + _usbh_port_disconnected(port); } } |