[rtems commit] bsp/stm32h7: Constify some functions

Sebastian Huber sebh at rtems.org
Tue Oct 27 05:14:34 UTC 2020


Module:    rtems
Branch:    master
Commit:    2cfcd005e9e4a14ccda6ab4bcd5f2466762cf86d
Changeset: http://git.rtems.org/rtems/commit/?id=2cfcd005e9e4a14ccda6ab4bcd5f2466762cf86d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar 19 11:28:45 2020 +0100

bsp/stm32h7: Constify some functions

Update #3910.

---

 bsps/arm/stm32h7/hal/stm32h7xx_hal_gpio.c       |  2 +-
 bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c        |  4 ++--
 bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc_ex.c     | 10 +++++-----
 bsps/arm/stm32h7/include/stm32h7xx_hal_gpio.h   |  2 +-
 bsps/arm/stm32h7/include/stm32h7xx_hal_rcc.h    |  4 ++--
 bsps/arm/stm32h7/include/stm32h7xx_hal_rcc_ex.h |  2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_gpio.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_gpio.c
index 13dcc40..4026ece 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_gpio.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_gpio.c
@@ -170,7 +170,7 @@
   *         the configuration information for the specified GPIO peripheral.
   * @retval None
   */
-void HAL_GPIO_Init(GPIO_TypeDef  *GPIOx, GPIO_InitTypeDef *GPIO_Init)
+void HAL_GPIO_Init(GPIO_TypeDef  *GPIOx, const GPIO_InitTypeDef *GPIO_Init)
 {
   uint32_t position = 0x00U;
   uint32_t iocurrent;
diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c
index 7d73fa5..f1c28a2 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c
@@ -399,7 +399,7 @@ HAL_StatusTypeDef HAL_RCC_DeInit(void)
   *         first and then HSE On or HSE Bypass.
   * @retval HAL status
   */
-__weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef  *RCC_OscInitStruct)
+__weak HAL_StatusTypeDef HAL_RCC_OscConfig(const RCC_OscInitTypeDef  *RCC_OscInitStruct)
 {
   uint32_t tickstart;
   uint32_t temp1_pllckcfg, temp2_pllckcfg;
@@ -879,7 +879,7 @@ __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef  *RCC_OscInitStruc
   *         (for more details refer to section above "Initialization/de-initialization functions")
   * @retval None
   */
-HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef  *RCC_ClkInitStruct, uint32_t FLatency)
+HAL_StatusTypeDef HAL_RCC_ClockConfig(const RCC_ClkInitTypeDef  *RCC_ClkInitStruct, uint32_t FLatency)
 {
   HAL_StatusTypeDef halstatus;
   uint32_t tickstart;
diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc_ex.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc_ex.c
index fa08e69..2c445e7 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc_ex.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc_ex.c
@@ -51,8 +51,8 @@
   */
 
 /* Private function prototypes -----------------------------------------------*/
-static HAL_StatusTypeDef RCCEx_PLL2_Config(RCC_PLL2InitTypeDef *pll2, uint32_t Divider);
-static HAL_StatusTypeDef RCCEx_PLL3_Config(RCC_PLL3InitTypeDef *pll3, uint32_t Divider);
+static HAL_StatusTypeDef RCCEx_PLL2_Config(const RCC_PLL2InitTypeDef *pll2, uint32_t Divider);
+static HAL_StatusTypeDef RCCEx_PLL3_Config(const RCC_PLL3InitTypeDef *pll3, uint32_t Divider);
 
 /* Exported functions --------------------------------------------------------*/
 /** @defgroup RCCEx_Exported_Functions Exported Functions
@@ -95,7 +95,7 @@ static HAL_StatusTypeDef RCCEx_PLL3_Config(RCC_PLL3InitTypeDef *pll3, uint32_t D
   *
   * @retval HAL status
   */
-HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef  *PeriphClkInit)
+HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(const RCC_PeriphCLKInitTypeDef  *PeriphClkInit)
 {
   uint32_t tmpreg;
   uint32_t tickstart;
@@ -3191,7 +3191,7 @@ __weak void HAL_RCCEx_CRS_ErrorCallback(uint32_t Error)
   *
   * @retval HAL status
   */
-static HAL_StatusTypeDef RCCEx_PLL2_Config(RCC_PLL2InitTypeDef *pll2, uint32_t Divider)
+static HAL_StatusTypeDef RCCEx_PLL2_Config(const RCC_PLL2InitTypeDef *pll2, uint32_t Divider)
 {
 
   uint32_t tickstart;
@@ -3296,7 +3296,7 @@ static HAL_StatusTypeDef RCCEx_PLL2_Config(RCC_PLL2InitTypeDef *pll2, uint32_t D
   *
   * @retval HAL status
   */
-static HAL_StatusTypeDef RCCEx_PLL3_Config(RCC_PLL3InitTypeDef *pll3, uint32_t Divider)
+static HAL_StatusTypeDef RCCEx_PLL3_Config(const RCC_PLL3InitTypeDef *pll3, uint32_t Divider)
 {
   uint32_t tickstart;
   HAL_StatusTypeDef status = HAL_OK;
diff --git a/bsps/arm/stm32h7/include/stm32h7xx_hal_gpio.h b/bsps/arm/stm32h7/include/stm32h7xx_hal_gpio.h
index c185566..f7f6eec 100644
--- a/bsps/arm/stm32h7/include/stm32h7xx_hal_gpio.h
+++ b/bsps/arm/stm32h7/include/stm32h7xx_hal_gpio.h
@@ -256,7 +256,7 @@ typedef enum
   * @{
   */
 /* Initialization and de-initialization functions *****************************/
-void  HAL_GPIO_Init(GPIO_TypeDef  *GPIOx, GPIO_InitTypeDef *GPIO_Init);
+void  HAL_GPIO_Init(GPIO_TypeDef  *GPIOx, const GPIO_InitTypeDef *GPIO_Init);
 void  HAL_GPIO_DeInit(GPIO_TypeDef  *GPIOx, uint32_t GPIO_Pin);
 /**
   * @}
diff --git a/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc.h b/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc.h
index ceb8644..08f29a0 100644
--- a/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc.h
+++ b/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc.h
@@ -7684,8 +7684,8 @@ typedef struct
   */
 /* Initialization and de-initialization functions  ******************************/
 HAL_StatusTypeDef HAL_RCC_DeInit(void);
-HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
-HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
+HAL_StatusTypeDef HAL_RCC_OscConfig(const RCC_OscInitTypeDef *RCC_OscInitStruct);
+HAL_StatusTypeDef HAL_RCC_ClockConfig(const RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
 
 /**
   * @}
diff --git a/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc_ex.h b/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc_ex.h
index 42beccc..0b99087 100644
--- a/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc_ex.h
+++ b/bsps/arm/stm32h7/include/stm32h7xx_hal_rcc_ex.h
@@ -3699,7 +3699,7 @@ typedef struct
 /** @addtogroup RCCEx_Exported_Functions_Group1
   * @{
   */
-HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef  *PeriphClkInit);
+HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(const RCC_PeriphCLKInitTypeDef  *PeriphClkInit);
 void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef  *PeriphClkInit);
 uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk);
 uint32_t HAL_RCCEx_GetD1PCLK1Freq(void);



More information about the vc mailing list