Skip to content

Commit

Permalink
Revert "4.4 maintenance uart enable/disable f4 (betaflight#13020)"
Browse files Browse the repository at this point in the history
This reverts commit 7294af8.
  • Loading branch information
haslinghuis committed Sep 20, 2023
1 parent 2f4948e commit 5535780
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main/drivers/serial_uart_stm32f4xx.c
Expand Up @@ -230,10 +230,6 @@ bool checkUsartTxOutput(uartPort_t *s)
// Enable USART TX output
uart->txPinState = TX_PIN_ACTIVE;
IOConfigGPIOAF(txIO, IOCFG_AF_PP, uart->hardware->af);

// Enable the UART transmitter
SET_BIT(s->USARTx->CR1, USART_CR1_TE);

return true;
} else {
// TX line is pulled low so don't enable USART TX
Expand All @@ -247,13 +243,9 @@ bool checkUsartTxOutput(uartPort_t *s)
void uartTxMonitor(uartPort_t *s)
{
uartDevice_t *uart = container_of(s, uartDevice_t, port);
IO_t txIO = IOGetByTag(uart->tx.pin);

if (uart->txPinState == TX_PIN_ACTIVE) {
IO_t txIO = IOGetByTag(uart->tx.pin);

// Disable the UART transmitter
CLEAR_BIT(s->USARTx->CR1, USART_CR1_TE);

// Switch TX to an input with pullup so it's state can be monitored
uart->txPinState = TX_PIN_MONITOR;
IOConfigGPIO(txIO, IOCFG_IPU);
Expand Down

0 comments on commit 5535780

Please sign in to comment.