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/nuttx.git

commit a8af5f3d0ec36701855296ac15971327fae584ac
Author: chao an <[email protected]>
AuthorDate: Thu Oct 16 10:52:00 2025 +0800

    style/spell: fix spell checker error
    
    To make checker happy:
    
    arch/arm/src/sama5/sam_classd.c:997: nd ==> and, 2nd
    arch/arm/src/sama5/sam_classd.c:1362: levl ==> level
    drivers/sensors/apds9922.c:286: persistance ==> persistence
    
    Signed-off-by: chao an <[email protected]>
---
 arch/arm/src/sama5/sam_classd.c  | 26 ++++++++++++-------------
 drivers/sensors/apds9922.c       | 42 ++++++++++++++++++++--------------------
 include/nuttx/sensors/apds9922.h |  4 ++--
 3 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/arm/src/sama5/sam_classd.c b/arch/arm/src/sama5/sam_classd.c
index 99aab249dc6..d4dc0a04095 100644
--- a/arch/arm/src/sama5/sam_classd.c
+++ b/arch/arm/src/sama5/sam_classd.c
@@ -911,7 +911,7 @@ void classd_dsp_clock_config(struct classd_dev_s *priv)
 #ifdef CONFIG_CLASSD_REGDEBUG
   /* double check clock settings */
 
-  uint32_t nd;
+  uint32_t divider;
   uint32_t fracr;
   uint32_t qdpmc;
   uint64_t clk = BOARD_MAINOSC_FREQUENCY;
@@ -990,11 +990,11 @@ void classd_dsp_clock_config(struct classd_dev_s *priv)
   classd_dump_registers("After dsp clock setup");
 
 #ifdef CONFIG_CLASSD_REGDEBUG
-  nd = (pll0 & PMC_AUDIO_PLL0_ND_MASK) >> PMC_AUDIO_PLL0_ND_SHIFT;
-  fracr = (pll1 & PMC_AUDIO_PLL1_FRACR_MASK) >> PMC_AUDIO_PLL1_FRACR_SHIFT;
-  qdpmc = (pll0 & PMC_AUDIO_PLL0_QDPMC_MASK) >> PMC_AUDIO_PLL0_QDPMC_SHIFT;
+  divider = (pll0 & PMC_AUDIO_PLL0_ND_MASK) >> PMC_AUDIO_PLL0_ND_SHIFT;
+  fracr   = (pll1 & PMC_AUDIO_PLL1_FRACR_MASK) >> PMC_AUDIO_PLL1_FRACR_SHIFT;
+  qdpmc   = (pll0 & PMC_AUDIO_PLL0_QDPMC_MASK) >> PMC_AUDIO_PLL0_QDPMC_SHIFT;
 
-  clk *= ((nd + 1) << 22) + fracr;
+  clk *= ((divider + 1) << 22) + fracr;
   clk /= 1 << 22;
   clk /= (qdpmc + 1);
   clk /= 8;
@@ -1359,8 +1359,8 @@ inline static uint8_t classd_get_atten(uint16_t volume, 
uint16_t balance)
 static int classd_setvolume(struct classd_dev_s *priv, uint16_t vol)
 {
   struct sam_classd_config_s *config;
-  uint32_t levl;
-  uint32_t levr;
+  uint32_t left;
+  uint32_t right;
   uint32_t bal;
   uint32_t regval;
 
@@ -1377,11 +1377,11 @@ static int classd_setvolume(struct classd_dev_s *priv, 
uint16_t vol)
   /* Calculate the attenuation value to send to the peripheral */
 
 #ifndef CONFIG_AUDIO_EXCLUDE_BALANCE
-  levl = classd_get_atten(vol, AUDIO_BALANCE_RIGHT - bal);
-  levr = classd_get_atten(vol, bal);
+  left  = classd_get_atten(vol, AUDIO_BALANCE_RIGHT - bal);
+  right = classd_get_atten(vol, bal);
 #else
-  levl = classd_get_atten(volume, AUDIO_BALANCE_CENTER);
-  levr = classd_get_atten(volume, AUDIO_BALANCE_CENTER);
+  left  = classd_get_atten(volume, AUDIO_BALANCE_CENTER);
+  right = classd_get_atten(volume, AUDIO_BALANCE_CENTER);
 #endif
 
   /* Set the volume */
@@ -1389,8 +1389,8 @@ static int classd_setvolume(struct classd_dev_s *priv, 
uint16_t vol)
   regval = classd_getreg(priv, SAM_CLASSD_INTPMR);
   regval &= ~CLASSD_INTPMR_ATTL_MASK;
   regval &= ~CLASSD_INTPMR_ATTR_MASK;
-  regval |= CLASSD_VOL_LEFT(levl);
-  regval |= CLASSD_VOL_RIGHT(levr);
+  regval |= CLASSD_VOL_LEFT(left);
+  regval |= CLASSD_VOL_RIGHT(right);
 
   classd_putreg(SAM_CLASSD_INTPMR, regval);
 
diff --git a/drivers/sensors/apds9922.c b/drivers/sensors/apds9922.c
index a2ee99c355e..1a11854a301 100644
--- a/drivers/sensors/apds9922.c
+++ b/drivers/sensors/apds9922.c
@@ -282,8 +282,8 @@ static int apds9922_als_gain(FAR struct apds9922_dev_s 
*priv, uint8_t gain);
 static int apds9922_autogain(FAR struct apds9922_dev_s *priv, bool enable);
 static int apds9922_als_resolution(FAR struct apds9922_dev_s *priv, int res);
 static int apds9922_als_rate(FAR struct apds9922_dev_s *priv, int rate);
-static int apds9922_als_persistance(FAR struct apds9922_dev_s *priv,
-                                    uint8_t persistance);
+static int apds9922_als_persistence(FAR struct apds9922_dev_s *priv,
+                                    uint8_t persistence);
 static int apds9922_als_variance(FAR struct apds9922_dev_s *priv,
                                  uint8_t variance);
 static int apds9922_als_thresh(FAR struct apds9922_dev_s *priv,
@@ -312,8 +312,8 @@ static int apds9922_ps_thresh(FAR struct apds9922_dev_s 
*priv,
 static int apds9922_ps_canc_lev(FAR struct apds9922_dev_s *priv,
                                 uint16_t lev);
 static int apds9922_ps_int_mode(FAR struct apds9922_dev_s *priv, int mode);
-static int apds9922_ps_persistance(FAR struct apds9922_dev_s *priv,
-                                   uint8_t persistance);
+static int apds9922_ps_persistence(FAR struct apds9922_dev_s *priv,
+                                   uint8_t persistence);
 static int apds9922_ps_notify_mode(FAR struct apds9922_dev_s *priv,
                                    int notify);
 
@@ -539,7 +539,7 @@ static int apds9922_reset(FAR struct apds9922_dev_s *priv)
   priv->als_setup.thresh.lower = ALS_DEF_THRESHL;
   priv->als_setup.thresh_var   = ALS_DEF_VAR;
   priv->als_setup.int_mode     = ALS_INT_MODE_THRESHOLD;
-  priv->als_setup.persistance  = ALS_DEF_PERSISTANCE;
+  priv->als_setup.persistence  = ALS_DEF_PERSISTANCE;
   priv->als_setup.als_factor   = 1;
   priv->als_setup.range_lim    = 1;
   priv->als_setup.autogain     = false;
@@ -554,7 +554,7 @@ static int apds9922_reset(FAR struct apds9922_dev_s *priv)
   priv->ps_setup.thresh.upper  = PS_DEF_THRESHU;
   priv->ps_setup.thresh.lower  = PS_DEF_THRESHL;
   priv->ps_setup.cancel_lev    = PS_DEF_CANCEL_LVL;
-  priv->ps_setup.persistance   = PS_DEF_PERSISTANCE;
+  priv->ps_setup.persistence   = PS_DEF_PERSISTANCE;
   priv->ps_setup.notify        = PS_ALL_INFO;
   priv->ps_setup.int_mode      = PS_INT_MODE_NORMAL;
 
@@ -662,7 +662,7 @@ static int apds9922_als_config(FAR struct apds9922_dev_s 
*priv,
       return ret;
     }
 
-  ret = apds9922_als_persistance(priv, config->persistance);
+  ret = apds9922_als_persistence(priv, config->persistence);
   if (ret < 0)
     {
       return ret;
@@ -981,7 +981,7 @@ static int apds9922_als_variance(FAR struct apds9922_dev_s 
*priv,
 }
 
 /****************************************************************************
- * Name: apds9922_als_persistance
+ * Name: apds9922_als_persistence
  *
  * Description:
  *   Set the number of consecutive int events needed before int is asserted.
@@ -995,13 +995,13 @@ static int apds9922_als_variance(FAR struct 
apds9922_dev_s *priv,
  *
  ****************************************************************************/
 
-static int apds9922_als_persistance(FAR struct apds9922_dev_s *priv,
-                                    uint8_t persistance)
+static int apds9922_als_persistence(FAR struct apds9922_dev_s *priv,
+                                    uint8_t persistence)
 {
   uint8_t regval;
   int ret;
 
-  if (persistance > ALS_PERSISTANCE_MAX)
+  if (persistence > ALS_PERSISTANCE_MAX)
     {
       return -EINVAL;
     }
@@ -1013,14 +1013,14 @@ static int apds9922_als_persistance(FAR struct 
apds9922_dev_s *priv,
     }
 
   regval &= ~ALS_PERSISTANCE_MASK;
-  regval |= ALS_SET_PERSISTANCE(persistance);
+  regval |= ALS_SET_PERSISTANCE(persistence);
   ret = apds9922_i2c_write(priv, APDS9922_INT_PERSIST, &regval, 1);
   if (ret < 0)
     {
       return ret;
     }
 
-  priv->als_setup.persistance = persistance;
+  priv->als_setup.persistence = persistence;
 
   return OK;
 }
@@ -1281,7 +1281,7 @@ static int apds9922_ps_config(FAR struct apds9922_dev_s 
*priv,
       return ret;
     }
 
-  ret = apds9922_ps_persistance(priv, config->persistance)  ;
+  ret = apds9922_ps_persistence(priv, config->persistence)  ;
   if (ret < 0)
     {
       return ret;
@@ -1710,27 +1710,27 @@ static int apds9922_ps_int_mode(FAR struct 
apds9922_dev_s *priv, int mode)
 }
 
 /****************************************************************************
- * Name: apds9922_ps_persistance
+ * Name: apds9922_ps_persistence
  *
  * Description:
  *   Set the number of consecutive int events needed before int is asserted.
  *
  * Input Parameters:
  *  priv        - pointer to device structure
- *  persistance - number of values to be out of range before int asserted
+ *  persistence - number of values to be out of range before int asserted
  *
  * Returned Value:
  *   Success or failure
  *
  ****************************************************************************/
 
-static int apds9922_ps_persistance(FAR struct apds9922_dev_s *priv,
-                                   uint8_t persistance)
+static int apds9922_ps_persistence(FAR struct apds9922_dev_s *priv,
+                                   uint8_t persistence)
 {
   uint8_t regval;
   int ret;
 
-  if (persistance > PS_PERSISTANCE_MAX)
+  if (persistence > PS_PERSISTANCE_MAX)
     {
       return -EINVAL;
     }
@@ -1742,14 +1742,14 @@ static int apds9922_ps_persistance(FAR struct 
apds9922_dev_s *priv,
     }
 
   regval &= ~PS_PERSISTANCE_MASK;
-  regval |= PS_SET_PERSISTANCE(persistance);
+  regval |= PS_SET_PERSISTANCE(persistence);
   ret = apds9922_i2c_write(priv, APDS9922_INT_PERSIST, &regval, 1);
   if (ret < 0)
     {
       return ret;
     }
 
-  priv->ps_setup.persistance = persistance;
+  priv->ps_setup.persistence = persistence;
 
   return OK;
 }
diff --git a/include/nuttx/sensors/apds9922.h b/include/nuttx/sensors/apds9922.h
index a616f64c888..f7e054c9df7 100644
--- a/include/nuttx/sensors/apds9922.h
+++ b/include/nuttx/sensors/apds9922.h
@@ -198,7 +198,7 @@ struct apds9922_als_setup_s
            thresh;      /* Upper and lower thresholds        */
   uint8_t  thresh_var;  /* threshold variation               */
   int      int_mode;    /* Interrupt mode                    */
-  uint8_t  persistance; /* Num events before interrupt       */
+  uint8_t  persistence; /* Num events before interrupt       */
   uint32_t als_factor;  /* Lux correction factor applied     */
   uint32_t range_lim;   /* % limit of ADC full range
                          * allowed in autogain mode.
@@ -221,7 +221,7 @@ struct apds9922_ps_setup_s
            thresh;      /* Upper and lower thresholds        */
   uint16_t cancel_lev;  /* Intelligent cancellation lev.     */
   int      int_mode;    /* Interrupt mode                    */
-  uint8_t  persistance; /* Num events before interrupt       */
+  uint8_t  persistence; /* Num events before interrupt       */
   int      notify;      /* States that cause a notify        */
 };
 

Reply via email to