From c1b06cc1205adcc9a94b8163ad76f14488fc79cc Mon Sep 17 00:00:00 2001 From: lbernstone Date: Tue, 1 Dec 2020 07:36:44 -0700 Subject: [PATCH] Fix possible race condition in uart attach (#4569) --- 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 3571042b..1cf8d2a9 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)