From c41614ea66196b2e05b57a24064be449aa8a8830 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 24 Feb 2013 07:08:44 +0000 Subject: [PATCH] Fixed bug 3605793. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5304 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/serial_usb.c | 5 +++-- readme.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index 23a323356..000d13951 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -323,8 +323,9 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { chSysLockFromIsr(); usbStartTransmitI(usbp, ep); } - else if (!(usbp->epc[ep]->in_state->txsize & - (usbp->epc[ep]->in_maxsize - 1))) { + else if ((usbp->epc[ep]->in_state->txsize > 0) && + !(usbp->epc[ep]->in_state->txsize & + (usbp->epc[ep]->in_maxsize - 1))) { /* Transmit zero sized packet in case the last one has maximum allowed size. Otherwise the recipient may expect more data coming soon and not return buffered data to app. See section 5.8.3 Bulk Transfer diff --git a/readme.txt b/readme.txt index a41f50c19..6f7b6ebd8 100644 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,7 @@ ***************************************************************************** *** 2.5.2 *** +- FIX: Fixed deadlock in Serial_USB driver (bug 3605793). - FIX: Fixed compile Error OLIMEX_SAM7_EX256/board.c (bug 3605058). - FIX: Fixed bug prevents calling adcStartConversionI() within ISR (bug 3605053)(backported to 2.4.4).