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


The following commit(s) were added to refs/heads/master by this push:
     new 4ccaedf  arch/stm32h7: Fix nxstyle errors
4ccaedf is described below

commit 4ccaedf91f60e87c289baede2326662635673c56
Author: Nathan Hartman <[email protected]>
AuthorDate: Mon Jan 4 11:40:03 2021 -0500

    arch/stm32h7: Fix nxstyle errors
    
    arch/arm/src/stm32h7/stm32_adc.c:
    arch/arm/src/stm32h7/stm32_adc.h:
    
        * Fix nxstyle issues.
---
 arch/arm/src/stm32h7/stm32_adc.c | 32 +++++++++++++++++++++-----------
 arch/arm/src/stm32h7/stm32_adc.h | 40 +++++++++++++++++++++-------------------
 2 files changed, 42 insertions(+), 30 deletions(-)

diff --git a/arch/arm/src/stm32h7/stm32_adc.c b/arch/arm/src/stm32h7/stm32_adc.c
index db2290b..4609111 100644
--- a/arch/arm/src/stm32h7/stm32_adc.c
+++ b/arch/arm/src/stm32h7/stm32_adc.c
@@ -551,7 +551,8 @@ static void adc_putregm(FAR struct stm32_dev_s *priv, int 
offset,
 static void adc_modifyregm(FAR struct stm32_dev_s *priv, int offset,
                           uint32_t clrbits, uint32_t setbits)
 {
-  adc_putregm(priv, offset, (adc_getregm(priv, offset) & ~clrbits) | setbits);
+  adc_putregm(priv, offset,
+              (adc_getregm(priv, offset) & ~clrbits) | setbits);
 }
 
 /****************************************************************************
@@ -1568,8 +1569,8 @@ static void adc_rxint(FAR struct adc_dev_s *dev, bool 
enable)
  * Name: adc_sqrbits
  ****************************************************************************/
 
-static uint32_t adc_sqrbits(FAR struct stm32_dev_s *priv, int first, int last,
-                            int offset)
+static uint32_t adc_sqrbits(FAR struct stm32_dev_s *priv, int first,
+                            int last, int offset)
 {
   uint32_t bits = 0;
   int i;
@@ -1691,17 +1692,21 @@ static int adc_set_ch(FAR struct adc_dev_s *dev, 
uint8_t ch)
 
   DEBUGASSERT(priv->nchannels <= ADC_MAX_SAMPLES);
 
-  bits = adc_sqrbits(priv, ADC_SQR4_FIRST, ADC_SQR4_LAST, ADC_SQR4_SQ_OFFSET);
+  bits = adc_sqrbits(priv, ADC_SQR4_FIRST, ADC_SQR4_LAST,
+                     ADC_SQR4_SQ_OFFSET);
   adc_modifyreg(priv, STM32_ADC_SQR4_OFFSET, ~ADC_SQR4_RESERVED, bits);
 
-  bits = adc_sqrbits(priv, ADC_SQR3_FIRST, ADC_SQR3_LAST, ADC_SQR3_SQ_OFFSET);
+  bits = adc_sqrbits(priv, ADC_SQR3_FIRST, ADC_SQR3_LAST,
+                     ADC_SQR3_SQ_OFFSET);
   adc_modifyreg(priv, STM32_ADC_SQR3_OFFSET, ~ADC_SQR3_RESERVED, bits);
 
-  bits = adc_sqrbits(priv, ADC_SQR2_FIRST, ADC_SQR2_LAST, ADC_SQR2_SQ_OFFSET);
+  bits = adc_sqrbits(priv, ADC_SQR2_FIRST, ADC_SQR2_LAST,
+                     ADC_SQR2_SQ_OFFSET);
   adc_modifyreg(priv, STM32_ADC_SQR2_OFFSET, ~ADC_SQR2_RESERVED, bits);
 
   bits = ((uint32_t)priv->nchannels - 1) << ADC_SQR1_L_SHIFT |
-         adc_sqrbits(priv, ADC_SQR1_FIRST, ADC_SQR1_LAST, ADC_SQR1_SQ_OFFSET);
+         adc_sqrbits(priv, ADC_SQR1_FIRST, ADC_SQR1_LAST,
+                     ADC_SQR1_SQ_OFFSET);
   adc_modifyreg(priv, STM32_ADC_SQR1_OFFSET, ~ADC_SQR1_RESERVED, bits);
 
 #ifdef ADC_HAVE_DFSDM
@@ -1835,7 +1840,8 @@ static int adc_interrupt(FAR struct adc_dev_s *dev, 
uint32_t adcisr)
       value  = adc_getreg(priv, STM32_ADC_DR_OFFSET);
       value &= ADC_DR_MASK;
 
-      awarn("WARNING: Analog Watchdog, Value (0x%03x) out of range!\n", value);
+      awarn("WARNING: Analog Watchdog, Value (0x%03x) out of range!\n",
+            value);
 
       /* Stop ADC conversions to avoid continuous interrupts */
 
@@ -1874,7 +1880,9 @@ static int adc_interrupt(FAR struct adc_dev_s *dev, 
uint32_t adcisr)
           priv->cb->au_receive(dev, priv->chanlist[priv->current], value);
         }
 
-      /* Set the channel number of the next channel that will complete 
conversion */
+      /* Set the channel number of the next channel that will complete
+       * conversion
+       */
 
       priv->current++;
 
@@ -1988,7 +1996,8 @@ static int adc3_interrupt(int irq, FAR void *context, FAR 
void *arg)
  ****************************************************************************/
 
 #ifdef ADC_HAVE_DMA
-static void adc_dmaconvcallback(DMA_HANDLE handle, uint8_t isr, FAR void *arg)
+static void adc_dmaconvcallback(DMA_HANDLE handle, uint8_t isr,
+                                FAR void *arg)
 {
   FAR struct adc_dev_s   *dev  = (FAR struct adc_dev_s *)arg;
   FAR struct stm32_dev_s *priv = (FAR struct stm32_dev_s *)dev->ad_priv;
@@ -2051,7 +2060,8 @@ static void adc_dmaconvcallback(DMA_HANDLE handle, 
uint8_t isr, FAR void *arg)
  *
  ****************************************************************************/
 
-struct adc_dev_s *stm32h7_adc_initialize(int intf, FAR const uint8_t *chanlist,
+struct adc_dev_s *stm32h7_adc_initialize(int intf,
+                                         FAR const uint8_t *chanlist,
                                          int cchannels)
 {
   FAR struct adc_dev_s   *dev;
diff --git a/arch/arm/src/stm32h7/stm32_adc.h b/arch/arm/src/stm32h7/stm32_adc.h
index 1c967c1..8cd0a93 100644
--- a/arch/arm/src/stm32h7/stm32_adc.h
+++ b/arch/arm/src/stm32h7/stm32_adc.h
@@ -1,7 +1,8 @@
-/************************************************************************************
+/****************************************************************************
  * arch/arm/src/stm32h7/stm32_adc.h
  *
- *   Copyright (C) 2009, 2011, 2015-2017,2019 Gregory Nutt. All rights 
reserved.
+ *   Copyright (C) 2009, 2011, 2015-2017,2019 Gregory Nutt. All rights
+ *   reserved.
  *   Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
  *   Authors: Gregory Nutt <[email protected]>
  *            Paul Alexander Patience <[email protected]>
@@ -34,30 +35,32 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- 
************************************************************************************/
+ ****************************************************************************/
 
 #ifndef __ARCH_ARM_SRC_STM32H7_STM32_ADC_H
 #define __ARCH_ARM_SRC_STM32H7_STM32_ADC_H
 
-/************************************************************************************
+/****************************************************************************
  * Included Files
- 
************************************************************************************/
+ ****************************************************************************/
 
 #include <nuttx/config.h>
 #include <nuttx/analog/adc.h>
 #include "chip.h"
 #include "hardware/stm32_adc.h"
 
-/************************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
- 
************************************************************************************/
-/* Configuration 
********************************************************************/
-
-/* Timer devices may be used for different purposes.  One special purpose is to
- * control periodic ADC sampling.  If CONFIG_STM32H7_TIMn is defined then
- * CONFIG_STM32H7_TIMn_ADC must also be defined to indicate that timer "n" is
- * intended to be used for that purpose. Timers 1,2,3,6 and 15 may be used on
- * STM32H7X3, while STM32H7X6 adds support for timers 4 and 8 as well.
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* Timer devices may be used for different purposes.  One special purpose is
+ * to control periodic ADC sampling.  If CONFIG_STM32H7_TIMn is defined then
+ * CONFIG_STM32H7_TIMn_ADC must also be defined to indicate that timer "n"
+ * is intended to be used for that purpose. Timers 1,2,3,6 and 15 may be
+ * used on STM32H7X3, while STM32H7X6 adds support for timers 4 and 8 as
+ * well.
  */
 
 #ifndef CONFIG_STM32H7_TIM1
@@ -469,7 +472,6 @@
 #define ADC3_EXTSEL_T15CC4     ADC_CFGR_EXTSEL_T15CC4
 #define ADC3_EXTSEL_T15TRGO    ADC_CFGR_EXTSEL_T15TRGO
 
-
 #if defined(CONFIG_STM32H7_TIM1_ADC1)
 #  if CONFIG_STM32H7_ADC1_TIMTRIG == 0
 #    define ADC1_EXTSEL_VALUE ADC1_EXTSEL_T1CC1
@@ -782,13 +784,13 @@
 #  endif
 #endif
 
-/************************************************************************************
+/****************************************************************************
  * Public Types
- 
************************************************************************************/
+ ****************************************************************************/
 
-/************************************************************************************
+/****************************************************************************
  * Public Function Prototypes
- 
************************************************************************************/
+ ****************************************************************************/
 
 #ifndef __ASSEMBLY__
 #ifdef __cplusplus

Reply via email to