From f32e8bf381a0141cf1818aed33474238a1570626 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 11 Jun 2012 19:23:28 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4269 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/OTGv1/usb_lld.c | 25 ++++++++++++++----------- 1 file 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.*/ -- cgit v1.2.3