git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_16.1.x@8971 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-02-28 08:42:01 +00:00
parent 93060d8617
commit d615ac19db
2 changed files with 16 additions and 0 deletions

View File

@ -309,6 +309,7 @@ void usbStart(USBDriver *usbp, const USBConfig *config) {
* @api
*/
void usbStop(USBDriver *usbp) {
unsigned i;
osalDbgCheck(usbp != NULL);
@ -319,6 +320,19 @@ void usbStop(USBDriver *usbp) {
"invalid state");
usb_lld_stop(usbp);
usbp->state = USB_STOP;
/* Resetting all ongoing synchronous operations.*/
for (i = 0; i <= (unsigned)USB_MAX_ENDPOINTS; i++) {
if (usbp->epc[i] != NULL) {
if (usbp->epc[i]->in_state != NULL) {
osalThreadResumeI(&usbp->epc[i]->in_state->thread, MSG_RESET);
}
if (usbp->epc[i]->out_state != NULL) {
osalThreadResumeI(&usbp->epc[i]->out_state->thread, MSG_RESET);
}
}
}
osalOsRescheduleS();
osalSysUnlock();
}

View File

@ -74,6 +74,8 @@
*** 16.1.4 ***
- ALL: Startup files relicensed under Apache 2.0.
- HAL: Fixed usbStop does not resume threads suspended in synchronous calls
to usbTransmit (bug #714).
- VAR: Fixed state check in lwIP when SYS_LIGHTWEIGHT_PROT is disabled
(bug #713).
- RT: Fixed race condition in RT registry (bug #712).