diff --git a/src/main/drivers/serial_uart_stm32f7xx.c b/src/main/drivers/serial_uart_stm32f7xx.c index 7bde2a94c..aeb6906a1 100644 --- a/src/main/drivers/serial_uart_stm32f7xx.c +++ b/src/main/drivers/serial_uart_stm32f7xx.c @@ -341,9 +341,14 @@ uartPort_t *serialUART(UARTDevice device, uint32_t baudRate, portMode_t mode, po IO_t rxIO = IOGetByTag(uartdev->rx); if ((options & SERIAL_BIDIR) && txIO) { - // XXX BIDIR_PP handling is missing + ioConfig_t ioCfg = IO_CONFIG( + ((options & SERIAL_INVERTED) || (options & SERIAL_BIDIR_PP)) ? GPIO_MODE_AF_PP : GPIO_MODE_AF_OD, + GPIO_SPEED_FREQ_HIGH, + ((options & SERIAL_INVERTED) || (options & SERIAL_BIDIR_PP)) ? GPIO_PULLDOWN : GPIO_PULLUP + ); + IOInit(txIO, OWNER_SERIAL_TX, RESOURCE_INDEX(device)); - IOConfigGPIOAF(txIO, IOCFG_AF_PP, hardware->af); + IOConfigGPIOAF(txIO, ioCfg, hardware->af); } else { if ((mode & MODE_TX) && txIO) { diff --git a/src/main/target/SITL/target.c b/src/main/target/SITL/target.c index b94d75c39..1e573f77f 100644 --- a/src/main/target/SITL/target.c +++ b/src/main/target/SITL/target.c @@ -22,7 +22,6 @@ #include #include -#include #include "drivers/io.h" #include "drivers/dma.h"