From 686ac77a3181ea308decfab5dfb6f9c84d51ec79 Mon Sep 17 00:00:00 2001
From: edolomb <none@example.com>
Date: Fri, 25 Aug 2017 08:53:22 +0000
Subject: Minor changes in sama_xdmac driver

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10488 35acf78f-673a-0410-8e92-d51de3d6d3f4
---
 os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c | 20 ++++----------------
 os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h | 11 +++++++++++
 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
@@ -94,18 +94,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.
  *
@@ -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.
-- 
cgit v1.2.3