From e46710d75621a2117ae5ddaad7e38d88e6abfaac Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Tue, 24 Nov 2020 08:31:02 -0700 Subject: [PATCH] Fix possible race condition in uart attach --- cores/esp32/esp32-hal-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 3571042bb0c..1cf8d2a9d9d 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -185,8 +185,8 @@ void uartAttachRx(uart_t* uart, uint8_t rxPin, bool inverted) return; } pinMode(rxPin, INPUT); - pinMatrixInAttach(rxPin, UART_RXD_IDX(uart->num), inverted); uartEnableInterrupt(uart); + pinMatrixInAttach(rxPin, UART_RXD_IDX(uart->num), inverted); } void uartAttachTx(uart_t* uart, uint8_t txPin, bool inverted)