summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2015-04-06 16:01:20 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2015-04-06 19:53:03 +0200
commit0827b6982bb67136c7a3c1bd1d4b0ba1924efbb7 (patch)
treea6590c3f5e8c3c17049d9adf5ccf9f13fa4aaefa /src
parentf86aacc59c2e1ba483c848f794fce877490ba460 (diff)
downloadsecure-hid-0827b6982bb67136c7a3c1bd1d4b0ba1924efbb7.tar.gz
secure-hid-0827b6982bb67136c7a3c1bd1d4b0ba1924efbb7.tar.bz2
secure-hid-0827b6982bb67136c7a3c1bd1d4b0ba1924efbb7.zip
LLD: stm32f4: change type of i to signed integer
this was causing infinite loop, when size of the data was not multiple of 4. Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/usbh_lld_stm32f4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/usbh_lld_stm32f4.c b/src/usbh_lld_stm32f4.c
index ad14d2e..4ee9d77 100644
--- a/src/usbh_lld_stm32f4.c
+++ b/src/usbh_lld_stm32f4.c
@@ -341,15 +341,16 @@ static void stm32f4_usbh_write(void *drvdata, const usbh_packet_t *packet)
volatile uint32_t *fifo = &REBASE_CH(OTG_FIFO, channel) + RX_FIFO_SIZE;
const uint32_t * buf32 = packet->data;
- uint32_t i;
+ int i;
for(i = packet->datalen; i > 0; i-=4) {
*fifo++ = *buf32++;
}
+
} else {
volatile uint32_t *fifo = &REBASE_CH(OTG_FIFO, channel) +
RX_FIFO_SIZE + TX_NP_FIFO_SIZE;
const uint32_t * buf32 = packet->data;
- uint32_t i;
+ int i;
for(i = packet->datalen; i > 0; i-=4) {
*fifo++ = *buf32++;
}