Skip to content

Commit aefa147

Browse files
ccli8adbridge
authored andcommitted
Fix PDMA error on timeout
1 parent 9127a1a commit aefa147

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

targets/TARGET_NUVOTON/TARGET_M451/dma_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static void pdma_vec(void)
165165
PDMA->INTSTS = reqto;
166166

167167
while (reqto) {
168-
int chn_id = nu_ctz(reqto) >> PDMA_INTSTS_REQTOFn_Pos;
168+
int chn_id = nu_ctz(reqto) - PDMA_INTSTS_REQTOFn_Pos;
169169
if (dma_chn_mask & (1 << chn_id)) {
170170
struct nu_dma_chn_s *dma_chn = dma_chn_arr + chn_id;
171171
if (dma_chn->handler && (dma_chn->event & DMA_EVENT_TIMEOUT)) {

targets/TARGET_NUVOTON/TARGET_NUC472/dma_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static void pdma_vec(void)
165165
PDMA->INTSTS = reqto;
166166

167167
while (reqto) {
168-
int chn_id = nu_ctz(reqto) >> PDMA_INTSTS_REQTOFX_Pos;
168+
int chn_id = nu_ctz(reqto) - PDMA_INTSTS_REQTOFX_Pos;
169169
if (dma_chn_mask & (1 << chn_id)) {
170170
struct nu_dma_chn_s *dma_chn = dma_chn_arr + chn_id;
171171
if (dma_chn->handler && (dma_chn->event & DMA_EVENT_TIMEOUT)) {

0 commit comments

Comments
 (0)