UART: Fix RX pin mode on F1

This commit is contained in:
Daniel Fekete 2017-05-08 19:52:54 +02:00
parent 871d6b7076
commit 348132f3c4
1 changed files with 4 additions and 0 deletions

View File

@ -35,7 +35,11 @@ void stm32AfUARTInit(const USART_TypeDef *instance,
GPIO_TypeDef *rxPort, uint32_t rxPin,
GPIO_TypeDef *txPort, uint32_t txPin) {
#ifdef STM32F1
stm32AfInit(chip_af_usart_rx, sizeof(chip_af_usart_rx) / sizeof(chip_af_usart_rx[0]), instance, rxPort, rxPin, GPIO_MODE_AF_INPUT, GPIO_PULLUP);
#else
stm32AfInit(chip_af_usart_rx, sizeof(chip_af_usart_rx) / sizeof(chip_af_usart_rx[0]), instance, rxPort, rxPin, GPIO_MODE_AF_PP, GPIO_PULLUP);
#endif
stm32AfInit(chip_af_usart_tx, sizeof(chip_af_usart_tx) / sizeof(chip_af_usart_tx[0]), instance, txPort, txPin, GPIO_MODE_AF_PP, GPIO_PULLUP);
}