aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/SAMA
diff options
context:
space:
mode:
authoredolomb <none@example.com>2018-02-20 07:49:24 +0000
committeredolomb <none@example.com>2018-02-20 07:49:24 +0000
commit62c60d2f4a420d1b6ceb47d22c4e629300c6aa34 (patch)
tree03664142237f663071f99e8c0b9df4281c60737d /os/hal/ports/SAMA
parentf67ca4ef37ab1c257b5b611ad8c83def9965dfea (diff)
downloadChibiOS-62c60d2f4a420d1b6ceb47d22c4e629300c6aa34.tar.gz
ChibiOS-62c60d2f4a420d1b6ceb47d22c4e629300c6aa34.tar.bz2
ChibiOS-62c60d2f4a420d1b6ceb47d22c4e629300c6aa34.zip
Fixed bugs and code optimized
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11516 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/SAMA')
-rw-r--r--os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c18
1 files changed, 5 insertions, 13 deletions
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();