Mercurial > public > ostc4
diff Small_CPU/Src/stm32f4xx_hal_msp_v3.c @ 696:cc542448fb28
Merge
author | heinrichsweikamp |
---|---|
date | Fri, 19 Aug 2022 11:30:24 +0200 |
parents | 1b995079c045 |
children | f72613a152dd |
line wrap: on
line diff
--- a/Small_CPU/Src/stm32f4xx_hal_msp_v3.c Mon Nov 01 12:39:34 2021 +0100 +++ b/Small_CPU/Src/stm32f4xx_hal_msp_v3.c Fri Aug 19 11:30:24 2022 +0200 @@ -229,14 +229,18 @@ { GPIO_InitTypeDef GPIO_InitStruct; - if(huart->Instance==USART2) + if(huart->Instance==USART1) { - __USART2_CLK_ENABLE(); - GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; + __GPIOA_CLK_ENABLE(); + __USART1_CLK_ENABLE(); + GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_LOW; - GPIO_InitStruct.Alternate = GPIO_AF7_USART2; + GPIO_InitStruct.Speed = GPIO_SPEED_FAST; //GPIO_SPEED_LOW; + GPIO_InitStruct.Alternate = GPIO_AF7_USART1; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_10; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } } @@ -244,10 +248,11 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) { - if(huart->Instance==USART2) + if(huart->Instance==USART1) { - __USART2_CLK_DISABLE(); - HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3); + HAL_NVIC_DisableIRQ(USART1_IRQn); + __USART1_CLK_DISABLE(); + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); } }