aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-11 19:23:28 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-11 19:23:28 +0000
commitf32e8bf381a0141cf1818aed33474238a1570626 (patch)
treeec448085a87aeae7baf056d4da64499b166fec1c
parentaed1b78c87e45112a1e84baa502a0057199dae1c (diff)
downloadChibiOS-f32e8bf381a0141cf1818aed33474238a1570626.tar.gz
ChibiOS-f32e8bf381a0141cf1818aed33474238a1570626.tar.bz2
ChibiOS-f32e8bf381a0141cf1818aed33474238a1570626.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4269 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index fbc95b405..03fadadd9 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -315,18 +315,21 @@ static void otg_fifo_read_to_queue(InputQueue *iqp, size_t n) {
*iqp->q_wrptr++ = (uint8_t)(dw >> 8);
if (iqp->q_wrptr >= iqp->q_top)
iqp->q_wrptr = iqp->q_buffer;
+
+ if (--nb > 0) {
+ *iqp->q_wrptr++ = (uint8_t)(dw >> 16);
+ if (iqp->q_wrptr >= iqp->q_top)
+ iqp->q_wrptr = iqp->q_buffer;
+
+ if (--nb > 0) {
+ *iqp->q_wrptr++ = (uint8_t)(dw >> 24);
+ if (iqp->q_wrptr >= iqp->q_top)
+ iqp->q_wrptr = iqp->q_buffer;
+
+ --nb;
+ }
+ }
}
- else if (--nb > 0) {
- *iqp->q_wrptr++ = (uint8_t)(dw >> 16);
- if (iqp->q_wrptr >= iqp->q_top)
- iqp->q_wrptr = iqp->q_buffer;
- }
- else if (--nb > 0) {
- *iqp->q_wrptr++ = (uint8_t)(dw >> 24);
- if (iqp->q_wrptr >= iqp->q_top)
- iqp->q_wrptr = iqp->q_buffer;
- }
- --nb;
} while (--nw > 0);
/* Updating queue.*/