From 62c60d2f4a420d1b6ceb47d22c4e629300c6aa34 Mon Sep 17 00:00:00 2001 From: edolomb Date: Tue, 20 Feb 2018 07:49:24 +0000 Subject: Fixed bugs and code optimized git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11516 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'os/hal/ports') diff --git a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c index 10793ea40..64a70edda 100644 --- a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c +++ b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c @@ -96,12 +96,11 @@ OSAL_IRQ_HANDLER(dmaHandler) { #if SAMA_HAL_IS_SECURE Xdmac *xdmac = XDMAC0; - mtxConfigPeriphSecurity(MATRIX0, ID_XDMAC0, SECURE_PER); #else Xdmac *xdmac = XDMAC1; #endif /* SAMA_HAL_IS_SECURE */ - uint32_t chan, gis, flags; + uint32_t chan, gis; /* Read Global Interrupt Status Register */ gis = dmaGetGlobalInt(xdmac); @@ -118,26 +117,19 @@ OSAL_IRQ_HANDLER(dmaHandler) { /* Channel is free */ continue; - uint32_t cis = dmaGetChannelInt(channel); - - if (cis & XDMAC_CIS_BIS) { - if (!(dmaGetChannelIntMask(channel) & XDMAC_CIM_LIM)) { - pendingInt = TRUE; - } - } + uint32_t cis = (dmaGetChannelInt(channel)) & ~(dmaGetChannelIntMask(channel)); - if (cis & XDMAC_CIS_LIS) { + if (cis) { pendingInt = TRUE; } - if (cis & XDMAC_CIS_DIS) { + if (cis & (XDMAC_CIS_LIS|XDMAC_CIS_DIS)) { pendingInt = TRUE; } - flags = cis; /* Executes callback */ if (pendingInt && channel->dma_func) { - channel->dma_func(channel->dma_param,flags); + channel->dma_func(channel->dma_param,cis); } } aicAckInt(); -- cgit v1.2.3