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>
This commit is contained in:
parent
f86aacc59c
commit
0827b6982b
1 changed files with 3 additions and 2 deletions
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue