diff --git a/src/main/drivers/stm32/serial_uart_stm32f4xx.c b/src/main/drivers/stm32/serial_uart_stm32f4xx.c index cacce07bb8..a5ffe3b060 100644 --- a/src/main/drivers/stm32/serial_uart_stm32f4xx.c +++ b/src/main/drivers/stm32/serial_uart_stm32f4xx.c @@ -245,9 +245,11 @@ void uartTxMonitor(uartPort_t *s) uartDevice_t *uart = container_of(s, uartDevice_t, port); IO_t txIO = IOGetByTag(uart->tx.pin); - // Switch TX to an input with pullup so it's state can be monitored - uart->txPinState = TX_PIN_MONITOR; - IOConfigGPIO(txIO, IOCFG_IPU); + if (uart->txPinState == TX_PIN_ACTIVE) { + // Switch TX to an input with pullup so it's state can be monitored + uart->txPinState = TX_PIN_MONITOR; + IOConfigGPIO(txIO, IOCFG_IPU); + } } static void handleUsartTxDma(uartPort_t *s) @@ -335,7 +337,7 @@ uartPort_t *serialUART(UARTDevice_e device, uint32_t baudRate, portMode_e mode, // Switch TX to an input with pullup so it's state can be monitored uartTxMonitor(s); } else { - IOConfigGPIOAF(txIO, IOCFG_AF_PP, hardware->af); + IOConfigGPIOAF(txIO, IOCFG_AF_PP_UP, hardware->af); } }