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 2022/08/27 12:40:11 UTC

[incubator-nuttx] branch master updated (51d31cc4a2 -> d7e2704dff)

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

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


    from 51d31cc4a2 cpuload: fix cpuload error
     new 9a85a0959a stm32/Kconfig: remove the unnecessary option
     new c563d8a993 arch/stm32/stm32_pwm.c: cosmetics
     new b01ea50e44 arch/stm32/stm32_foc.c: cosmetics
     new d7e2704dff arch/stm32/stm32_adc.c: cosmetics

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/arm/src/stm32/Kconfig     |  1 -
 arch/arm/src/stm32/stm32_adc.c | 46 +++++++++++++++++++++---------------------
 arch/arm/src/stm32/stm32_foc.c |  2 +-
 arch/arm/src/stm32/stm32_pwm.c |  5 +++--
 4 files changed, 27 insertions(+), 27 deletions(-)


[incubator-nuttx] 02/04: arch/stm32/stm32_pwm.c: cosmetics

Posted by xi...@apache.org.
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 c563d8a993330a570ab6893f4a47172dd42efaca
Author: raiden00pl <ra...@railab.me>
AuthorDate: Wed Aug 17 14:21:52 2022 +0200

    arch/stm32/stm32_pwm.c: cosmetics
---
 arch/arm/src/stm32/stm32_pwm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c
index 6468ac3983..df937654cd 100644
--- a/arch/arm/src/stm32/stm32_pwm.c
+++ b/arch/arm/src/stm32/stm32_pwm.c
@@ -37,7 +37,8 @@
 #include "arm_internal.h"
 #include "chip.h"
 #include "stm32_pwm.h"
-#include "stm32.h"
+#include "stm32_rcc.h"
+#include "stm32_gpio.h"
 
 /* This module then only compiles if there is at least one enabled timer
  * intended for use with the PWM upper half driver.
@@ -374,7 +375,7 @@ struct stm32_pwmtimer_s
   uint8_t  chan_num:3;              /* Number of configured channels */
   uint8_t  timtype:3;               /* See the TIMTYPE_* definitions */
   uint8_t  mode:3;                  /* Timer mode (see stm32_pwm_tim_mode_e) */
-  uint8_t  lock:2;                  /* TODO: Lock configuration */
+  uint8_t  lock:2;                  /* Lock configuration */
   uint8_t  t_dts:3;                 /* Clock division for t_DTS */
   uint8_t  _res:5;                  /* Reserved */
 #ifdef HAVE_PWM_COMPLEMENTARY


[incubator-nuttx] 03/04: arch/stm32/stm32_foc.c: cosmetics

Posted by xi...@apache.org.
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 b01ea50e44e8affcde07301d0341305405302bda
Author: raiden00pl <ra...@railab.me>
AuthorDate: Wed Aug 17 14:22:03 2022 +0200

    arch/stm32/stm32_foc.c: cosmetics
---
 arch/arm/src/stm32/stm32_foc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/stm32/stm32_foc.c b/arch/arm/src/stm32/stm32_foc.c
index 9d67ead8c3..956049fbd5 100644
--- a/arch/arm/src/stm32/stm32_foc.c
+++ b/arch/arm/src/stm32/stm32_foc.c
@@ -222,7 +222,7 @@
 /* FOC ADC trigger on CCR4 **************************************************/
 
 /* PWM channels configuration:
- *   - n channels for phases PWM (CCR1, CCR2, CCR3)
+ *   - 3 channels for phases PWM (CCR1, CCR2, CCR3)
  *   - 1 channel for ADC injection sequence trigger (CCR4)
  */
 


[incubator-nuttx] 04/04: arch/stm32/stm32_adc.c: cosmetics

Posted by xi...@apache.org.
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 d7e2704dff673995b712b8d0b13a168bca617b2e
Author: raiden00pl <ra...@railab.me>
AuthorDate: Wed Aug 17 14:22:18 2022 +0200

    arch/stm32/stm32_adc.c: cosmetics
---
 arch/arm/src/stm32/stm32_adc.c | 46 +++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c
index db646c8341..d16c605b00 100644
--- a/arch/arm/src/stm32/stm32_adc.c
+++ b/arch/arm/src/stm32/stm32_adc.c
@@ -45,7 +45,8 @@
 
 #include "arm_internal.h"
 #include "chip.h"
-#include "stm32.h"
+#include "stm32_rcc.h"
+#include "stm32_tim.h"
 #include "stm32_dma.h"
 #include "stm32_adc.h"
 
@@ -67,11 +68,6 @@
 
 #ifdef CONFIG_STM32_ADC
 
-/* Some ADC peripheral must be enabled */
-
-#if defined(CONFIG_STM32_ADC1) || defined(CONFIG_STM32_ADC2) || \
-    defined(CONFIG_STM32_ADC3) || defined(CONFIG_STM32_ADC4)
-
 /* This implementation is for the STM32 ADC IP version 1 and 2 */
 
 #if !defined(HAVE_IP_ADC_V1) && !defined(HAVE_IP_ADC_V2)
@@ -1832,7 +1828,7 @@ static int adccmn_lock(struct stm32_dev_s *priv, bool lock)
  *   reset values. It could set all the ADCs configured.
  *
  * Input Parameters:
- *   regaddr - The register to read
+ *   priv  - A reference to the ADC block status
  *   reset - Condition, set or reset
  *
  * Returned Value:
@@ -2516,7 +2512,7 @@ static void adc_voltreg_cfg(struct stm32_dev_s *priv)
 #endif
 
 /****************************************************************************
- * Name: adc_voltreg_cfg
+ * Name: adc_sampletime_cfg
  ****************************************************************************/
 
 static void adc_sampletime_cfg(struct adc_dev_s *dev)
@@ -3233,8 +3229,8 @@ static int adc_extcfg_set(struct stm32_dev_s *priv, uint32_t extcfg)
 
   /* Get EXTEN and EXTSEL from input */
 
-  exten = (extcfg & ADC_EXTREG_EXTEN_MASK);
-  extsel = (extcfg & ADC_EXTREG_EXTSEL_MASK);
+  exten = extcfg & ADC_EXTREG_EXTEN_MASK;
+  extsel = extcfg & ADC_EXTREG_EXTSEL_MASK;
 
   /* EXTSEL selection: These bits select the external event used
    * to trigger the start of conversion of a regular group.  NOTE:
@@ -3246,8 +3242,8 @@ static int adc_extcfg_set(struct stm32_dev_s *priv, uint32_t extcfg)
 
   if (exten > 0)
     {
-      setbits = (extsel | exten);
-      clrbits = (ADC_EXTREG_EXTEN_MASK | ADC_EXTREG_EXTSEL_MASK);
+      setbits = extsel | exten;
+      clrbits = ADC_EXTREG_EXTEN_MASK | ADC_EXTREG_EXTSEL_MASK;
 
       ainfo("Initializing extsel = 0x%08" PRIx32 "\n", extsel);
 
@@ -3274,8 +3270,8 @@ static int adc_jextcfg_set(struct stm32_dev_s *priv, uint32_t jextcfg)
 
   /* Get JEXTEN and JEXTSEL from input */
 
-  jexten = (jextcfg & ADC_JEXTREG_JEXTEN_MASK);
-  jextsel = (jextcfg & ADC_JEXTREG_JEXTSEL_MASK);
+  jexten = jextcfg & ADC_JEXTREG_JEXTEN_MASK;
+  jextsel = jextcfg & ADC_JEXTREG_JEXTSEL_MASK;
 
   /* JEXTSEL selection: These bits select the external event used
    * to trigger the start of conversion of a injected group.  NOTE:
@@ -3287,8 +3283,8 @@ static int adc_jextcfg_set(struct stm32_dev_s *priv, uint32_t jextcfg)
 
   if (jexten > 0)
     {
-      setbits = (jexten | jextsel);
-      clrbits = (ADC_JEXTREG_JEXTEN_MASK | ADC_JEXTREG_JEXTSEL_MASK);
+      setbits = jexten | jextsel;
+      clrbits = ADC_JEXTREG_JEXTEN_MASK | ADC_JEXTREG_JEXTSEL_MASK;
 
       ainfo("Initializing jextsel = 0x%08" PRIx32 "\n", jextsel);
 
@@ -3721,7 +3717,7 @@ static int adc_set_ch(struct adc_dev_s *dev, uint8_t ch)
           return -ENODEV;
         }
 
-      priv->current   = i;
+      priv->current    = i;
       priv->rnchannels = 1;
     }
 
@@ -4557,9 +4553,8 @@ static void adc_sampletime_write(struct stm32_adc_dev_s *dev)
  *   either for every channels or for only some predefined by user channel(s)
  *
  * Input Parameters:
- *   priv     - pointer to the adc device structure
- *   pdi_high - true:  The ADC is powered down when waiting for a start event
- *              false: The ADC is powered up when waiting for a start event
+ *   dev          - pointer to the adc device structure
+ *   time_samples - pointe to the adc sample time configuration data
  *
  * Returned Value:
  *   None
@@ -4758,6 +4753,10 @@ struct adc_dev_s *stm32_adcinitialize(int intf, const uint8_t *chanlist,
   /* Configure regular channels */
 
   DEBUGASSERT(cr_channels <= CONFIG_STM32_ADC_MAX_SAMPLES);
+  if (cr_channels > CONFIG_STM32_ADC_MAX_SAMPLES)
+    {
+      cr_channels = CONFIG_STM32_ADC_MAX_SAMPLES;
+    }
 
   priv->cr_channels = cr_channels;
   memcpy(priv->r_chanlist, chanlist, cr_channels);
@@ -4766,6 +4765,10 @@ struct adc_dev_s *stm32_adcinitialize(int intf, const uint8_t *chanlist,
   /* Configure injected channels */
 
   DEBUGASSERT(cj_channels <= ADC_INJ_MAX_SAMPLES);
+  if (cj_channels > ADC_INJ_MAX_SAMPLES)
+    {
+      cj_channels = ADC_INJ_MAX_SAMPLES;
+    }
 
   priv->cj_channels = cj_channels;
   memcpy(priv->j_chanlist, j_chanlist, cj_channels);
@@ -4808,7 +4811,4 @@ struct adc_dev_s *stm32_adcinitialize(int intf, const uint8_t *chanlist,
   return dev;
 }
 
-#endif /* CONFIG_STM32_ADC1 || CONFIG_STM32_ADC2 ||
-        * CONFIG_STM32_ADC3 || CONFIG_STM32_ADC4
-        */
 #endif /* CONFIG_STM32_ADC */


[incubator-nuttx] 01/04: stm32/Kconfig: remove the unnecessary option

Posted by xi...@apache.org.
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 9a85a0959aeca4893b5667e27a0748e9593033a3
Author: raiden00pl <ra...@railab.me>
AuthorDate: Wed Aug 17 14:21:27 2022 +0200

    stm32/Kconfig: remove the unnecessary option
---
 arch/arm/src/stm32/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig
index 366bc2ab76..efaf943a55 100644
--- a/arch/arm/src/stm32/Kconfig
+++ b/arch/arm/src/stm32/Kconfig
@@ -12024,7 +12024,6 @@ menuconfig STM32_FOC
 	select STM32_ADC_LL_OPS
 	select STM32_ADC_CHANGE_SAMPLETIME
 	select STM32_ADC_NO_STARTUP_CONV
-	select STM32_ADC_FORCE_SCAN if STM32_HAVE_IP_ADC_V1
 
 if STM32_FOC