From ae33f9eed7e2dffdb526d571a8090ad1bf02815a Mon Sep 17 00:00:00 2001 From: ccli8 Date: Tue, 7 Mar 2017 17:48:37 +0800 Subject: [PATCH] [M487] Fix PDMA error on timeout --- targets/TARGET_NUVOTON/TARGET_M480/dma_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c b/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c index d46ddb4dfa..f21368848a 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c @@ -158,7 +158,7 @@ static void pdma_vec(void) PDMA->INTSTS = reqto; while (reqto) { - int chn_id = nu_ctz(reqto) >> PDMA_INTSTS_REQTOF0_Pos; + int chn_id = nu_ctz(reqto) - PDMA_INTSTS_REQTOF0_Pos; if (dma_chn_mask & (1 << chn_id)) { struct nu_dma_chn_s *dma_chn = dma_chn_arr + chn_id; if (dma_chn->handler && (dma_chn->event & DMA_EVENT_TIMEOUT)) {