aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-28 08:42:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-28 08:42:09 +0000
commite75648ec64e3b9d8bf2c8d7b621d1c4fd4616e56 (patch)
tree8b24c586119c2f68cc29e6a0ca8369a4b9df9c18
parent4491129f54af198c7df8507b07e2d3a93581b998 (diff)
downloadChibiOS-e75648ec64e3b9d8bf2c8d7b621d1c4fd4616e56.tar.gz
ChibiOS-e75648ec64e3b9d8bf2c8d7b621d1c4fd4616e56.tar.bz2
ChibiOS-e75648ec64e3b9d8bf2c8d7b621d1c4fd4616e56.zip
Fixed bug #714.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8972 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/src/usb.c14
-rw-r--r--readme.txt2
2 files changed, 16 insertions, 0 deletions
diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c
index 1b4993e49..8e557d14e 100644
--- a/os/hal/src/usb.c
+++ b/os/hal/src/usb.c
@@ -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();
}
diff --git a/readme.txt b/readme.txt
index a047fb224..21e4e9171 100644
--- a/readme.txt
+++ b/readme.txt
@@ -92,6 +92,8 @@
- RT: Merged RT4.
- NIL: Merged NIL2.
- NIL: Added STM32F7 demo.
+- HAL: Fixed usbStop does not resume threads suspended in synchronous calls
+ to usbTransmit (bug #714)(backported to 16.1.4).
- VAR: Fixed state check in lwIP when SYS_LIGHTWEIGHT_PROT is disabled
(bug #713)(backported to 2.6.10, 3.0.6 and 16.1.4).
- RT: Removed the p_msg field from the thread_t structure saving a