You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2020/11/06 02:11:46 UTC

[incubator-nuttx] 01/03: drivers:audio: cxd56: move helpers to the header file

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d572b06a6ca9d2e12222691e09f7795a0d8930d0
Author: Tobias Johansson <to...@sony.com>
AuthorDate: Thu Nov 5 10:15:34 2020 +0100

    drivers:audio: cxd56: move helpers to the header file
    
    The Queue helpers should be moved to the header file
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 drivers/audio/cxd56.c | 12 +-----------
 drivers/audio/cxd56.h | 12 ++++++++++++
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c
index 15f7d67..9f01ccd 100644
--- a/drivers/audio/cxd56.c
+++ b/drivers/audio/cxd56.c
@@ -170,17 +170,6 @@
 #define CXD56_DMA_CMD_FIFO_NOT_FULL 1
 #define CXD56_DMA_START_ADDR_MASK   0x3fffffff
 
-/* Queue helpers */
-
-#define dq_put(q,n) (dq_addlast((dq_entry_t*)n,(q)))
-#define dq_get(q)    (dq_remfirst(q))
-#define dq_clear(q) \
-  do \
-    { \
-      dq_remlast(q); \
-    } \
-  while (!dq_empty(q))
-
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
@@ -1360,6 +1349,7 @@ static void cxd56_dma_int_handler(void)
   else
     {
       audinfo("Unhandled interrupt\n");
+
       return;
     }
 
diff --git a/drivers/audio/cxd56.h b/drivers/audio/cxd56.h
index 685ed56..ccf45a7 100644
--- a/drivers/audio/cxd56.h
+++ b/drivers/audio/cxd56.h
@@ -227,6 +227,18 @@
 #  define CONFIG_CXD56_AUDIO_NUM_BUFFERS  4
 #endif
 
+/* Queue helpers */
+
+#define dq_get(q)    (dq_remfirst(q))
+#define dq_put(q,n) (dq_addlast((dq_entry_t*)n,(q)))
+#define dq_put_back(q,n) (dq_addfirst((dq_entry_t*)n,(q)))
+#define dq_clear(q) \
+  do \
+    { \
+      dq_remlast(q); \
+    } \
+  while (!dq_empty(q))
+
 /****************************************************************************
  * Public Types
  ****************************************************************************/