yaxing.chen пре 5 година
родитељ
комит
6d84f18eb1
2 измењених фајлова са 2 додато и 19 уклоњено
  1. 1 9
      drivers/baremetal/drv_usart.c
  2. 1 10
      drivers/nano/drv_usart.c

+ 1 - 9
drivers/baremetal/drv_usart.c

@@ -280,15 +280,6 @@ static long stm32_gpio_configure(struct stm32_uart_config *config)
     return 0;
 }
 
-void HAL_UART_MspInit(UART_HandleTypeDef *huart)
-{
-    /* if this uart is shell function */
-    if(huart == &handle)
-    {
-        stm32_gpio_configure(_uart_config);
-    }
-}
-
 static long stm32_configure(struct stm32_uart_config *config)
 {
     stm32_uart_clk_enable(config);
@@ -306,6 +297,7 @@ static long stm32_configure(struct stm32_uart_config *config)
     {
         return -1;
     }
+    stm32_gpio_configure(_uart_config);
 
     return 0;
 }

+ 1 - 10
drivers/nano/drv_usart.c

@@ -290,16 +290,6 @@ static rt_err_t stm32_gpio_configure(struct stm32_uart_config *config)
     return RT_EOK;
 }
 
-
-void HAL_UART_MspInit(UART_HandleTypeDef *huart)
-{
-    /* if this uart is shell function */
-    if(huart == &handle)
-    {
-        stm32_gpio_configure(_uart_config);
-    }
-}
-
 static rt_err_t stm32_configure(struct stm32_uart_config *config)
 {
     stm32_uart_clk_enable(config);
@@ -317,6 +307,7 @@ static rt_err_t stm32_configure(struct stm32_uart_config *config)
     {
         return -RT_ERROR;
     }
+    stm32_gpio_configure(_uart_config);
 
     return RT_EOK;
 }