Fixed bugs and code optimized
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11516 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
f67ca4ef37
commit
62c60d2f4a
|
@ -96,12 +96,11 @@ OSAL_IRQ_HANDLER(dmaHandler) {
|
||||||
|
|
||||||
#if SAMA_HAL_IS_SECURE
|
#if SAMA_HAL_IS_SECURE
|
||||||
Xdmac *xdmac = XDMAC0;
|
Xdmac *xdmac = XDMAC0;
|
||||||
mtxConfigPeriphSecurity(MATRIX0, ID_XDMAC0, SECURE_PER);
|
|
||||||
#else
|
#else
|
||||||
Xdmac *xdmac = XDMAC1;
|
Xdmac *xdmac = XDMAC1;
|
||||||
#endif /* SAMA_HAL_IS_SECURE */
|
#endif /* SAMA_HAL_IS_SECURE */
|
||||||
|
|
||||||
uint32_t chan, gis, flags;
|
uint32_t chan, gis;
|
||||||
|
|
||||||
/* Read Global Interrupt Status Register */
|
/* Read Global Interrupt Status Register */
|
||||||
gis = dmaGetGlobalInt(xdmac);
|
gis = dmaGetGlobalInt(xdmac);
|
||||||
|
@ -118,26 +117,19 @@ OSAL_IRQ_HANDLER(dmaHandler) {
|
||||||
/* Channel is free */
|
/* Channel is free */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint32_t cis = dmaGetChannelInt(channel);
|
uint32_t cis = (dmaGetChannelInt(channel)) & ~(dmaGetChannelIntMask(channel));
|
||||||
|
|
||||||
if (cis & XDMAC_CIS_BIS) {
|
if (cis) {
|
||||||
if (!(dmaGetChannelIntMask(channel) & XDMAC_CIM_LIM)) {
|
|
||||||
pendingInt = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cis & XDMAC_CIS_LIS) {
|
|
||||||
pendingInt = TRUE;
|
pendingInt = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cis & XDMAC_CIS_DIS) {
|
if (cis & (XDMAC_CIS_LIS|XDMAC_CIS_DIS)) {
|
||||||
pendingInt = TRUE;
|
pendingInt = TRUE;
|
||||||
}
|
}
|
||||||
flags = cis;
|
|
||||||
|
|
||||||
/* Executes callback */
|
/* Executes callback */
|
||||||
if (pendingInt && channel->dma_func) {
|
if (pendingInt && channel->dma_func) {
|
||||||
channel->dma_func(channel->dma_param,flags);
|
channel->dma_func(channel->dma_param,cis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aicAckInt();
|
aicAckInt();
|
||||||
|
|
Loading…
Reference in New Issue