You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/04/10 11:46:41 UTC

[incubator-nuttx] 03/03: boards: stm32l4: Fix nxstyle warning

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

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

commit aa7c1dc67fb8afb4efe7d6a47d80824e515644cb
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Fri Apr 9 13:35:59 2021 +0200

    boards: stm32l4: Fix nxstyle warning
    
    Port from a0fae8c4d61ce6f2915a7439141f3dff6905f46d
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 .../stm32l4/stm32l4r9ai-disco/src/stm32_dfsdm.c    | 38 +++++++++++++++++++---
 1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_dfsdm.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_dfsdm.c
index f6be8c6..7819952 100644
--- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_dfsdm.c
+++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_dfsdm.c
@@ -69,6 +69,33 @@ int stm32_dfsdm_setup(void)
     {
       int ret;
       struct adc_dev_s *adc;
+#ifdef CONFIG_STM32L4_DFSDM1_FLT0
+      const uint8_t chanlist0[1] =
+      {
+        0
+      };
+#endif
+
+#ifdef CONFIG_STM32L4_DFSDM1_FLT1
+      const uint8_t chanlist1[2] =
+      {
+        0, 1
+      };
+#endif
+
+#ifdef CONFIG_STM32L4_DFSDM1_FLT2
+      const uint8_t chanlist2[8] =
+      {
+        0, 1, 2, 3, 4, 5, 6, 7
+      };
+#endif
+
+#ifdef CONFIG_STM32L4_DFSDM1_FLT3
+      const uint8_t chanlist3[4] =
+      {
+        6, 5, 4, 3
+      };
+#endif
 
       ainfo("Initializing DFSDM\n");
 
@@ -78,7 +105,7 @@ int stm32_dfsdm_setup(void)
        */
 
 #ifdef CONFIG_STM32L4_DFSDM1_FLT0
-      adc = stm32l4_dfsdm_initialize(0, (const uint8_t[1]){0}, 1);
+      adc = stm32l4_dfsdm_initialize(0, chanlist0, 1);
       if (adc == NULL)
         {
           aerr("Failed to get DFSDM FLT0 interface\n");
@@ -92,8 +119,9 @@ int stm32_dfsdm_setup(void)
           return ret;
         }
 #endif
+
 #ifdef CONFIG_STM32L4_DFSDM1_FLT1
-      adc = stm32l4_dfsdm_initialize(1, (const uint8_t[2]){0,1}, 2);
+      adc = stm32l4_dfsdm_initialize(1, chanlist1, 2);
       if (adc == NULL)
         {
           aerr("Failed to get DFSDM FLT1 interface\n");
@@ -107,8 +135,9 @@ int stm32_dfsdm_setup(void)
           return ret;
         }
 #endif
+
 #ifdef CONFIG_STM32L4_DFSDM1_FLT2
-      adc = stm32l4_dfsdm_initialize(2, (const uint8_t[8]){0,1,2,3,4,5,6,7}, 8);
+      adc = stm32l4_dfsdm_initialize(2, chanlist2, 8);
       if (adc == NULL)
         {
           aerr("Failed to get DFSDM FLT2 interface\n");
@@ -122,8 +151,9 @@ int stm32_dfsdm_setup(void)
           return ret;
         }
 #endif
+
 #ifdef CONFIG_STM32L4_DFSDM1_FLT3
-      adc = stm32l4_dfsdm_initialize(3, (const uint8_t[4]){6,5,4,3}, 4);
+      adc = stm32l4_dfsdm_initialize(3, chanlist3, 4);
       if (adc == NULL)
         {
           aerr("Failed to get DFSDM FLT3 interface\n");