nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aguettou...@apache.org
Subject [incubator-nuttx] 01/02: arch/arm/stm32, stm32f7, stm32l4: Rename up_waste to stm32_waste
Date Sun, 03 May 2020 15:43:30 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 01d32a2b22a4ea0aa6e199f488fff9a809e56181
Author: Gregory Nutt <gnutt@nuttx.org>
AuthorDate: Sun May 3 08:35:35 2020 -0600

    arch/arm/stm32, stm32f7, stm32l4: Rename up_waste to stm32_waste
    
    The naming standard at https://cwiki.apache.org/confluence/display/NUTTX/Naming+FAQ requires
that all MCU-private functions begin with the name of the MCU, not up_.
    
    This PR addresses only these name changes for the STM32-private functions up_waste() which
should be called stm32_waste.
    
    There should be no impact of this change (other that one step toward more consistent naming).
    
    Normal PR checks are sufficient
---
 arch/arm/src/stm32/stm32_lse.c             |  4 ++--
 arch/arm/src/stm32/stm32_rtcounter.c       |  6 +++---
 arch/arm/src/stm32/stm32_waste.c           |  2 +-
 arch/arm/src/stm32/stm32_waste.h           |  4 ++--
 arch/arm/src/stm32/stm32f10xxf30xx_flash.c |  6 +++---
 arch/arm/src/stm32/stm32f20xxf40xx_flash.c | 14 ++++++++++----
 arch/arm/src/stm32/stm32l15xx_flash.c      |  8 ++++----
 arch/arm/src/stm32f7/stm32_flash.c         | 16 +++++++++++-----
 arch/arm/src/stm32l4/stm32l4_flash.c       |  8 ++++----
 arch/arm/src/stm32l4/stm32l4_lse.c         |  2 +-
 arch/arm/src/stm32l4/stm32l4_waste.c       |  2 +-
 arch/arm/src/stm32l4/stm32l4_waste.h       |  4 ++--
 12 files changed, 44 insertions(+), 32 deletions(-)

diff --git a/arch/arm/src/stm32/stm32_lse.c b/arch/arm/src/stm32/stm32_lse.c
index 36df76c..a76cc66 100644
--- a/arch/arm/src/stm32/stm32_lse.c
+++ b/arch/arm/src/stm32/stm32_lse.c
@@ -80,7 +80,7 @@ void stm32_rcc_enablelse(void)
 
   while ((getreg32(STM32_RCC_CSR) & RCC_CSR_LSERDY) == 0)
     {
-      up_waste();
+      stm32_waste();
     }
 
 #else
@@ -94,7 +94,7 @@ void stm32_rcc_enablelse(void)
 
   while ((getreg16(STM32_RCC_BDCR) & RCC_BDCR_LSERDY) == 0)
     {
-      up_waste();
+      stm32_waste();
     }
 
 #endif
diff --git a/arch/arm/src/stm32/stm32_rtcounter.c b/arch/arm/src/stm32/stm32_rtcounter.c
index f849da9..456962a 100644
--- a/arch/arm/src/stm32/stm32_rtcounter.c
+++ b/arch/arm/src/stm32/stm32_rtcounter.c
@@ -204,7 +204,7 @@ static inline void stm32_rtc_beginwr(void)
 
   while ((getreg16(STM32_RTC_CRL) & RTC_CRL_RTOFF) == 0)
     {
-      up_waste();
+      stm32_waste();
     }
 
   /* Enter Config mode, Set Value and Exit */
@@ -234,7 +234,7 @@ static inline void stm32_rtc_endwr(void)
 
   while ((getreg16(STM32_RTC_CRL) & RTC_CRL_RTOFF) == 0)
     {
-      up_waste();
+      stm32_waste();
     }
 }
 
@@ -257,7 +257,7 @@ static inline void stm32_rtc_wait4rsf(void)
   modifyreg16(STM32_RTC_CRL, RTC_CRL_RSF, 0);
   while ((getreg16(STM32_RTC_CRL) & RTC_CRL_RSF) == 0)
     {
-      up_waste();
+      stm32_waste();
     }
 }
 
diff --git a/arch/arm/src/stm32/stm32_waste.c b/arch/arm/src/stm32/stm32_waste.c
index a680b8b..df53b7d 100644
--- a/arch/arm/src/stm32/stm32_waste.c
+++ b/arch/arm/src/stm32/stm32_waste.c
@@ -51,7 +51,7 @@ uint32_t idle_wastecounter = 0;
  * Public Functions
  ****************************************************************************/
 
-void up_waste(void)
+void stm32_waste(void)
 {
   idle_wastecounter++;
 }
diff --git a/arch/arm/src/stm32/stm32_waste.h b/arch/arm/src/stm32/stm32_waste.h
index 6c800c7..74356b5 100644
--- a/arch/arm/src/stm32/stm32_waste.h
+++ b/arch/arm/src/stm32/stm32_waste.h
@@ -59,7 +59,7 @@ extern "C"
 
 /** Waste CPU Time
  *
- *   up_waste() is the logic that will be executed when portions of kernel
+ *   stm32_waste() is the logic that will be executed when portions of kernel
  *   or user-app is polling some register or similar, waiting for desired
  *   status. This time is wasted away. This function offers a measure of
  *   badly written piece of software or some undesired behavior.
@@ -68,7 +68,7 @@ extern "C"
  *   cannot be used for other purposes (yet).
  **/
 
-void up_waste(void);
+void stm32_waste(void);
 
 #undef EXTERN
 #if defined(__cplusplus)
diff --git a/arch/arm/src/stm32/stm32f10xxf30xx_flash.c b/arch/arm/src/stm32/stm32f10xxf30xx_flash.c
index ad49f26..5104698 100644
--- a/arch/arm/src/stm32/stm32f10xxf30xx_flash.c
+++ b/arch/arm/src/stm32/stm32f10xxf30xx_flash.c
@@ -108,7 +108,7 @@ static void flash_unlock(uintptr_t base)
 {
   while ((getreg32(base + STM32_FLASH_SR_OFFSET) & FLASH_SR_BSY) != 0)
     {
-      up_waste();
+      stm32_waste();
     }
 
   if ((getreg32(base + STM32_FLASH_CR_OFFSET) & FLASH_CR_LOCK) != 0)
@@ -292,7 +292,7 @@ ssize_t up_progmem_eraseblock(size_t block)
 
   while ((getreg32(base + STM32_FLASH_SR_OFFSET) & FLASH_SR_BSY) != 0)
     {
-      up_waste();
+      stm32_waste();
     }
 
   modifyreg32(base + STM32_FLASH_CR_OFFSET, FLASH_CR_PER, 0);
@@ -375,7 +375,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count)
 
       while ((getreg32(base + STM32_FLASH_SR_OFFSET) & FLASH_SR_BSY) != 0)
         {
-          up_waste();
+          stm32_waste();
         }
 
       /* Verify */
diff --git a/arch/arm/src/stm32/stm32f20xxf40xx_flash.c b/arch/arm/src/stm32/stm32f20xxf40xx_flash.c
index 0134517..51b9ef8 100644
--- a/arch/arm/src/stm32/stm32f20xxf40xx_flash.c
+++ b/arch/arm/src/stm32/stm32f20xxf40xx_flash.c
@@ -101,7 +101,7 @@ static void flash_unlock(void)
 {
   while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32_waste();
     }
 
   if (getreg32(STM32_FLASH_CR) & FLASH_CR_LOCK)
@@ -241,7 +241,7 @@ int stm32_flash_writeprotect(size_t page, bool enabled)
 
   while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32_waste();
     }
 
   /* Relock options */
@@ -365,7 +365,10 @@ ssize_t up_progmem_eraseblock(size_t block)
   modifyreg32(STM32_FLASH_CR, FLASH_CR_SNB_MASK, FLASH_CR_SNB(block));
   modifyreg32(STM32_FLASH_CR, 0, FLASH_CR_STRT);
 
-  while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
+  while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
+    {
+      stm32_waste();
+    }
 
   modifyreg32(STM32_FLASH_CR, FLASH_CR_SER, 0);
   sem_unlock();
@@ -428,7 +431,10 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count)
 
       putreg16(*hword, addr);
 
-      while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
+      while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
+        {
+          stm32_waste();
+        }
 
       /* Verify */
 
diff --git a/arch/arm/src/stm32/stm32l15xx_flash.c b/arch/arm/src/stm32/stm32l15xx_flash.c
index be00a21..28daa43 100644
--- a/arch/arm/src/stm32/stm32l15xx_flash.c
+++ b/arch/arm/src/stm32/stm32l15xx_flash.c
@@ -111,7 +111,7 @@ static void stm32_eeprom_unlock(void)
 {
   while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32_waste();
     }
 
   if (getreg32(STM32_FLASH_PECR) & FLASH_PECR_PELOCK)
@@ -221,7 +221,7 @@ static ssize_t stm32_eeprom_erase_write(size_t addr, const void *buf,
 
       while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
         {
-          up_waste();
+          stm32_waste();
         }
 
       /* Verify */
@@ -472,7 +472,7 @@ ssize_t up_progmem_eraseblock(size_t block)
 
   while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32_waste();
     }
 
   flash_lock();
@@ -538,7 +538,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count)
 
       while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
         {
-          up_waste();
+          stm32_waste();
         }
 
       /* Verify */
diff --git a/arch/arm/src/stm32f7/stm32_flash.c b/arch/arm/src/stm32f7/stm32_flash.c
index 9bf9370..9215bf4 100644
--- a/arch/arm/src/stm32f7/stm32_flash.c
+++ b/arch/arm/src/stm32f7/stm32_flash.c
@@ -83,7 +83,7 @@ static sem_t g_sem = SEM_INITIALIZER(1);
  * Private Functions
  ****************************************************************************/
 
-static void up_waste(void)
+static void stm32_waste(void)
 {
 }
 
@@ -101,7 +101,7 @@ static void flash_unlock(void)
 {
   while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32_waste();
     }
 
   if (getreg32(STM32_FLASH_CR) & FLASH_CR_LOCK)
@@ -223,7 +223,7 @@ int stm32_flash_writeprotect(size_t page, bool enabled)
 
   while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32_waste();
     }
 
   /* Re-lock options */
@@ -353,7 +353,10 @@ ssize_t up_progmem_eraseblock(size_t block)
   modifyreg32(STM32_FLASH_CR, FLASH_CR_SNB_MASK, FLASH_CR_SNB(block));
   modifyreg32(STM32_FLASH_CR, 0, FLASH_CR_STRT);
 
-  while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
+  while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
+    {
+      stm32_waste();
+    {
 
   modifyreg32(STM32_FLASH_CR, FLASH_CR_SER, 0);
   sem_unlock();
@@ -425,7 +428,10 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count)
 
       ARM_DSB();
 
-      while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste();
+      while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
+        {
+          stm32_waste();
+        }
 
       /* Verify */
 
diff --git a/arch/arm/src/stm32l4/stm32l4_flash.c b/arch/arm/src/stm32l4/stm32l4_flash.c
index db30dd3..833780e 100644
--- a/arch/arm/src/stm32l4/stm32l4_flash.c
+++ b/arch/arm/src/stm32l4/stm32l4_flash.c
@@ -132,7 +132,7 @@ static void flash_unlock(void)
 {
   while (getreg32(STM32L4_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32l4_waste();
     }
 
   if (getreg32(STM32L4_FLASH_CR) & FLASH_CR_LOCK)
@@ -196,7 +196,7 @@ static inline void flash_erase(size_t page)
 
   while (getreg32(STM32L4_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32l4_waste();
     }
 
   modifyreg32(STM32L4_FLASH_CR, FLASH_CR_PAGE_ERASE, 0);
@@ -311,7 +311,7 @@ uint32_t stm32l4_flash_user_optbytes(uint32_t clrbits, uint32_t setbits)
 
   while (getreg32(STM32L4_FLASH_SR) & FLASH_SR_BSY)
     {
-      up_waste();
+      stm32l4_waste();
     }
 
   flash_optbytes_lock();
@@ -530,7 +530,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t buflen)
 
           while (getreg32(STM32L4_FLASH_SR) & FLASH_SR_BSY)
             {
-              up_waste();
+              stm32l4_waste();
             }
 
           /* Verify */
diff --git a/arch/arm/src/stm32l4/stm32l4_lse.c b/arch/arm/src/stm32l4/stm32l4_lse.c
index ef68a56..a02c206 100644
--- a/arch/arm/src/stm32l4/stm32l4_lse.c
+++ b/arch/arm/src/stm32l4/stm32l4_lse.c
@@ -114,7 +114,7 @@ void stm32l4_rcc_enablelse(void)
 
       while (((regval = getreg32(STM32L4_RCC_BDCR)) & RCC_BDCR_LSERDY) == 0)
         {
-          up_waste();
+          stm32l4_waste();
         }
 
 #if defined(CONFIG_STM32L4_RTC_LSECLOCK_RUN_DRV_CAPABILITY) && \
diff --git a/arch/arm/src/stm32l4/stm32l4_waste.c b/arch/arm/src/stm32l4/stm32l4_waste.c
index cb71038..ed62663 100644
--- a/arch/arm/src/stm32l4/stm32l4_waste.c
+++ b/arch/arm/src/stm32l4/stm32l4_waste.c
@@ -51,7 +51,7 @@ uint32_t idle_wastecounter = 0;
  * Public Functions
  ****************************************************************************/
 
-void up_waste(void)
+void stm32l4_waste(void)
 {
   idle_wastecounter++;
 }
diff --git a/arch/arm/src/stm32l4/stm32l4_waste.h b/arch/arm/src/stm32l4/stm32l4_waste.h
index 4b00bf0..8301e4c 100644
--- a/arch/arm/src/stm32l4/stm32l4_waste.h
+++ b/arch/arm/src/stm32l4/stm32l4_waste.h
@@ -59,7 +59,7 @@ extern "C"
 
 /** Waste CPU Time
  *
- *   up_waste() is the logic that will be executed when portions of kernel
+ *   stm32l4_waste() is the logic that will be executed when portions of kernel
  *   or user-app is polling some register or similar, waiting for desired
  *   status. This time is wasted away. This function offers a measure of
  *   badly written piece of software or some undesired behavior.
@@ -68,7 +68,7 @@ extern "C"
  *   cannot be used for other purposes (yet).
  **/
 
-void up_waste(void);
+void stm32l4_waste(void);
 
 #undef EXTERN
 #if defined(__cplusplus)


Mime
View raw message