[rtems commit] bsp/stm32h7: Disable unused functions

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


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Apr  2 08:28:56 2020 +0200

bsp/stm32h7: Disable unused functions

Update #3910.

---

 bsps/arm/stm32h7/hal/stm32h7xx_hal.c       | 10 ++++++++++
 bsps/arm/stm32h7/hal/stm32h7xx_hal_eth.c   |  8 ++++++++
 bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c   |  6 ++++++
 bsps/arm/stm32h7/hal/stm32h7xx_hal_uart.c  |  2 ++
 bsps/arm/stm32h7/hal/stm32h7xx_hal_usart.c |  2 ++
 5 files changed, 28 insertions(+)

diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal.c
index 3e92312..8fc0f84 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal.c
@@ -68,9 +68,11 @@
 /** @defgroup HAL_Exported_Variables HAL Exported Variables
   * @{
   */
+#ifndef __rtems__
 __IO uint32_t uwTick;
 uint32_t uwTickPrio   = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */
 HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT;  /* 1KHz */
+#endif /* __rtems__ */
 /**
   * @}
   */
@@ -166,11 +168,13 @@ uint32_t common_system_clock;
   SystemCoreClock = common_system_clock;
 #endif /* DUAL_CORE && CORE_CM4 */
 
+#ifndef __rtems__
   /* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */
   if(HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
   {
     return HAL_ERROR;
   }
+#endif /* __rtems__ */
 
   /* Init the low level hardware */
   HAL_MspInit();
@@ -179,6 +183,7 @@ uint32_t common_system_clock;
   return HAL_OK;
 }
 
+#ifndef __rtems__
 /**
   * @brief  This function de-Initializes common part of the HAL and stops the systick.
   *         This function is optional.
@@ -220,7 +225,9 @@ HAL_StatusTypeDef HAL_DeInit(void)
   /* Return function status */
   return HAL_OK;
 }
+#endif /* __rtems__ */
 
+#ifndef __rtems__
 /**
   * @brief  Initializes the MSP.
   * @retval None
@@ -287,6 +294,7 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
   /* Return function status */
   return HAL_OK;
 }
+#endif /* __rtems__ */
 
 /**
   * @}
@@ -315,6 +323,7 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
   * @{
   */
 
+#ifndef __rtems__
 /**
   * @brief This function is called to increment  a global variable "uwTick"
   *        used as application time base.
@@ -448,6 +457,7 @@ __weak void HAL_ResumeTick(void)
   /* Enable SysTick Interrupt */
   SysTick->CTRL  |= SysTick_CTRL_TICKINT_Msk;
 }
+#endif /* __rtems__ */
 
 /**
   * @brief  Returns the HAL revision
diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_eth.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_eth.c
index afb215d..a1b1fa0 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_eth.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_eth.c
@@ -356,8 +356,10 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
   /*------------------ MAC, MTL and DMA default Configuration ----------------*/
   ETH_MACDMAConfig(heth);
 
+#ifndef __rtems__
   /* SET DSL to 64 bit */
   MODIFY_REG(heth->Instance->DMACCR, ETH_DMACCR_DSL, ETH_DMACCR_DSL_64BIT);
+#endif /* __rtems__ */
 
   /* Set Receive Buffers Length (must be a multiple of 4) */
   if ((heth->Init.RxBuffLen % 0x4U) != 0x0U)
@@ -427,6 +429,7 @@ HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth)
   return HAL_OK;
 }
 
+#ifndef __rtems__
 /**
   * @brief  Initializes the ETH MSP.
   * @param  heth: pointer to a ETH_HandleTypeDef structure that contains
@@ -441,6 +444,7 @@ __weak void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
   the HAL_ETH_MspInit could be implemented in the user file
   */
 }
+#endif /* __rtems__ */
 
 /**
   * @brief  DeInitializes ETH MSP.
@@ -2635,6 +2639,7 @@ static void ETH_MAC_MDIO_ClkConfig(ETH_HandleTypeDef *heth)
   */
 static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
 {
+#ifndef __rtems__
   ETH_DMADescTypeDef *dmatxdesc;
   uint32_t i;
 
@@ -2661,6 +2666,7 @@ static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
 
   /* Set Transmit Descriptor Tail pointer */
   WRITE_REG(heth->Instance->DMACTDTPR, (uint32_t) heth->Init.TxDesc);
+#endif /* __rtems__ */
 }
 
 /**
@@ -2672,6 +2678,7 @@ static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)
   */
 static void ETH_DMARxDescListInit(ETH_HandleTypeDef *heth)
 {
+#ifndef __rtems__
   ETH_DMADescTypeDef *dmarxdesc;
   uint32_t i;
 
@@ -2704,6 +2711,7 @@ static void ETH_DMARxDescListInit(ETH_HandleTypeDef *heth)
 
   /* Set Receive Descriptor Tail pointer Address */
   WRITE_REG(heth->Instance->DMACRDTPR, ((uint32_t)(heth->Init.RxDesc + (((uint32_t)(ETH_RX_DESC_CNT - 1))*sizeof(ETH_DMADescTypeDef)))));
+#endif /* __rtems__ */
 }
 
 /**
diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c
index 1176209..4b303c6 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_rcc.c
@@ -175,6 +175,7 @@
   * @{
   */
 
+#ifndef __rtems__
 /**
   * @brief  Resets the RCC clock configuration to the default reset state.
   * @note   The default reset state of the clock configuration is given below:
@@ -385,6 +386,7 @@ HAL_StatusTypeDef HAL_RCC_DeInit(void)
 
   return HAL_OK;
 }
+#endif /* __rtems__ */
 
 /**
   * @brief  Initializes the RCC Oscillators according to the specified parameters in the
@@ -1195,7 +1197,11 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(const RCC_ClkInitTypeDef  *RCC_ClkInitStru
 #endif /* DUAL_CORE && CORE_CM4 */
 
   /* Configure the source of time base considering new system clocks settings*/
+#ifndef __rtems__
   halstatus = HAL_InitTick (uwTickPrio);
+#else /* __rtems__ */
+  halstatus = HAL_OK;
+#endif /* __rtems__ */
 
   return halstatus;
 }
diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_uart.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_uart.c
index 85a0b6e..02dfb77 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_uart.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_uart.c
@@ -649,6 +649,7 @@ HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart)
   return HAL_OK;
 }
 
+#ifndef __rtems__
 /**
   * @brief Initialize the UART MSP.
   * @param huart UART handle.
@@ -663,6 +664,7 @@ __weak void HAL_UART_MspInit(UART_HandleTypeDef *huart)
             the HAL_UART_MspInit can be implemented in the user file
    */
 }
+#endif /* __rtems__ */
 
 /**
   * @brief DeInitialize the UART MSP.
diff --git a/bsps/arm/stm32h7/hal/stm32h7xx_hal_usart.c b/bsps/arm/stm32h7/hal/stm32h7xx_hal_usart.c
index 7157d59..ce0f2d2 100644
--- a/bsps/arm/stm32h7/hal/stm32h7xx_hal_usart.c
+++ b/bsps/arm/stm32h7/hal/stm32h7xx_hal_usart.c
@@ -372,6 +372,7 @@ HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart)
   return HAL_OK;
 }
 
+#ifndef __rtems__
 /**
   * @brief Initialize the USART MSP.
   * @param husart USART handle.
@@ -386,6 +387,7 @@ __weak void HAL_USART_MspInit(USART_HandleTypeDef *husart)
             the HAL_USART_MspInit can be implemented in the user file
    */
 }
+#endif /* __rtems__ */
 
 /**
   * @brief DeInitialize the USART MSP.



More information about the vc mailing list