From 1c4c762c0a5796e21a9b628b9bf5ac1e94bd791f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 14 May 2013 08:50:47 +0000 Subject: [PATCH] Fixed bug #410. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5734 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/USBv1/usb_lld.c | 8 +++----- readme.txt | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/os/hal/platforms/STM32/USBv1/usb_lld.c b/os/hal/platforms/STM32/USBv1/usb_lld.c index eac014de0..22af59866 100644 --- a/os/hal/platforms/STM32/USBv1/usb_lld.c +++ b/os/hal/platforms/STM32/USBv1/usb_lld.c @@ -350,13 +350,11 @@ CH_IRQ_HANDLER(STM32_USB1_LP_HANDLER) { transmitted = (size_t)USB_GET_DESCRIPTOR(ep)->TXCOUNT0; epcp->in_state->txcnt += transmitted; - epcp->in_state->txsize -= transmitted; - if (epcp->in_state->txsize > 0) { + n = epcp->in_state->txsize - epcp->in_state->txcnt; + if (n > 0) { /* Transfer not completed, there are more packets to send.*/ - if (epcp->in_state->txsize > epcp->in_maxsize) + if (n > epcp->in_maxsize) n = epcp->in_maxsize; - else - n = epcp->in_state->txsize; if (epcp->in_state->txqueued) usb_packet_write_from_queue(USB_GET_DESCRIPTOR(ep), diff --git a/readme.txt b/readme.txt index 594592590..a92dab5e0 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,7 @@ ***************************************************************************** *** 2.5.2 *** +- FIX: Fixed wrong STM32 USBv1 driver behavior (bug #410). - FIX: Fixed STM32 wrong peripherals reset procedure (bug #409)(backported to 2.4.4). - FIX: Fixed STM32 SPIv2 polled exchange (bug #372).