aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authoredolomb <none@example.com>2017-08-25 08:53:22 +0000
committeredolomb <none@example.com>2017-08-25 08:53:22 +0000
commit686ac77a3181ea308decfab5dfb6f9c84d51ec79 (patch)
tree4740f60886ba36c154d846e983f1468a2707f8d7 /os/hal
parentad80a8ed28114c33f139153f6750f52992c6ae25 (diff)
downloadChibiOS-686ac77a3181ea308decfab5dfb6f9c84d51ec79.tar.gz
ChibiOS-686ac77a3181ea308decfab5dfb6f9c84d51ec79.tar.bz2
ChibiOS-686ac77a3181ea308decfab5dfb6f9c84d51ec79.zip
Minor changes in sama_xdmac driver
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10488 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c20
-rw-r--r--os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h11
2 files changed, 15 insertions, 16 deletions
diff --git a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
index 9537fa6b0..1e4dc15f7 100644
--- a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
+++ b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
@@ -95,18 +95,6 @@ sama_dma_channel_t _sama_dma_channel_t[XDMAC_CHANNELS_TOT];
#define dmaGetGlobalInt(xdmacp) xdmacp->XDMAC_GIS
/**
- * @brief Get content of Channel Interrupt Status register.
- * @note Reading interrupt is equivalent to clearing interrupt.
- *
- * @param[in] dmachp pointer to a sama_dma_channel_t structure
- * @return XDMAC_CISx content of Channel Interrupt Status register
- *
- * @notapi
- */
-#define dmaGetChannelInt(dmachp) \
- (dmachp)->xdmac->XDMAC_CHID[(dmachp)->chid].XDMAC_CIS
-
-/**
* @brief Get content of Channel Interrupt Mask register.
*
* @param[in] dmachp pointer to a sama_dma_channel_t structure
@@ -144,7 +132,7 @@ OSAL_IRQ_HANDLER(dmaHandler) {
gcs = dmaGetGlobal(xdmac);
for (chan = 0; chan < XDMAC_CHANNELS; chan++) {
sama_dma_channel_t *channel = &_sama_dma_channel_t[(cont * XDMAC_CHANNELS) + chan];
- bool pendingInt = false;
+ bool pendingInt = 0;
if (!(gis & (0x1 << chan)))
/* There is no pending interrupt for this channel */
@@ -159,16 +147,16 @@ OSAL_IRQ_HANDLER(dmaHandler) {
if (cis & XDMAC_CIS_BIS) {
if (!(dmaGetChannelIntMask(channel) & XDMAC_CIM_LIM)) {
- pendingInt = true;
+ pendingInt = 1;
}
}
if (cis & XDMAC_CIS_LIS) {
- pendingInt = true;
+ pendingInt = 1;
}
if (cis & XDMAC_CIS_DIS) {
- pendingInt = true;;
+ pendingInt = 1;
}
}
/* Execute callback */
diff --git a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h
index 52c3dc2d3..c4c871f46 100644
--- a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h
+++ b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h
@@ -110,6 +110,17 @@ typedef struct {
* @name Macro Functions
* @{
*/
+/**
+ * @brief Get content of Channel Interrupt Status register.
+ * @note Reading interrupt is equivalent to clearing interrupt.
+ *
+ * @param[in] dmachp pointer to a sama_dma_channel_t structure
+ * @return XDMAC_CISx content of Channel Interrupt Status register
+ *
+ * @notapi
+ */
+#define dmaGetChannelInt(dmachp) \
+ (dmachp)->xdmac->XDMAC_CHID[(dmachp)->chid].XDMAC_CIS
/**
* @brief Associates a source to a DMA channel.