From e2bd93c0920346cfbe3c792e82b0b3f99f4354a0 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Fri, 22 Sep 2017 14:17:25 +0800 Subject: [PATCH] Fix UART0 not able to read/available --- cores/esp32/esp32-hal-uart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 222bbcb2..20e7a9b9 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -197,6 +197,9 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx } else if(uart_nr == 2){ DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_UART2_CLK_EN); DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_UART2_RST); + } else { + DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_UART_CLK_EN); + DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_UART_RST); } uartFlush(uart); uartSetBaudRate(uart, baudrate);