From 62a76c0e049998c6fda2f349503bee2fafd12bad Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Tue, 15 Sep 2020 16:08:23 +0200 Subject: [PATCH] nrf52: Fix edpt_dma_start() wrong condition check Operator < used in while condition was obviously incorrect. Loop starts with checking if unsigned variable is less then 0. This condition is always false. This reverses condition to follow intention of of the code. --- src/portable/nordic/nrf5x/dcd_nrf5x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portable/nordic/nrf5x/dcd_nrf5x.c b/src/portable/nordic/nrf5x/dcd_nrf5x.c index cd35f2e5b..60da9fb25 100644 --- a/src/portable/nordic/nrf5x/dcd_nrf5x.c +++ b/src/portable/nordic/nrf5x/dcd_nrf5x.c @@ -122,7 +122,7 @@ static void edpt_dma_start(volatile uint32_t* reg_startep) // for the DMA complete by comparing current pending DMA with number of ENDED Events uint32_t ended = 0; - while ( _dcd.dma_pending < ((uint8_t) ended) ) + while ( _dcd.dma_pending > ((uint8_t) ended) ) { ended = NRF_USBD->EVENTS_ENDISOIN + NRF_USBD->EVENTS_ENDISOOUT;