aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal_usbh.c
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-06 09:23:07 -0300
committerDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-06 09:23:07 -0300
commit108ae2534cf5e487b569ea34bdae4e86b9c2d024 (patch)
tree8f7489782e72c9ed7c729c824ec9c96d2ad6a480 /os/hal/src/hal_usbh.c
parent0bf5a7aa4c0d6dcf8660d200452b584ef107eed5 (diff)
downloadChibiOS-Contrib-108ae2534cf5e487b569ea34bdae4e86b9c2d024.tar.gz
ChibiOS-Contrib-108ae2534cf5e487b569ea34bdae4e86b9c2d024.tar.bz2
ChibiOS-Contrib-108ae2534cf5e487b569ea34bdae4e86b9c2d024.zip
Fixed endpoint halt reset implementation
Diffstat (limited to 'os/hal/src/hal_usbh.c')
-rw-r--r--os/hal/src/hal_usbh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c
index 80180d6..11add0d 100644
--- a/os/hal/src/hal_usbh.c
+++ b/os/hal/src/hal_usbh.c
@@ -195,8 +195,7 @@ static void _ep0_object_init(usbh_device_t *dev, uint16_t wMaxPacketSize) {
usbhEPSetName(&dev->ctrl, "DEV[CTRL]");
}
-bool usbhEPResetS(usbh_ep_t *ep) {
- osalDbgCheckClassS();
+bool usbhEPReset(usbh_ep_t *ep) {
osalDbgCheck(ep != NULL);
osalDbgAssert((ep->status == USBH_EPSTATUS_OPEN) || (ep->status == USBH_EPSTATUS_HALTED), "invalid state");
osalDbgAssert(ep->type != USBH_EPTYPE_CTRL, "don't need to reset control endpoint");
@@ -206,9 +205,12 @@ bool usbhEPResetS(usbh_ep_t *ep) {
0, 0);
/* TODO: GET_STATUS to see if endpoint is still halted */
+ osalSysLock();
if ((ret == USBH_URBSTATUS_OK) && usbh_lld_ep_reset(ep)) {
+ osalSysUnlock();
return HAL_SUCCESS;
}
+ osalSysUnlock();
return HAL_FAILED;
}