Enable clocks for UART1 and 2
Recent change in IDF disables those clocks at boot. This change should help with that. Fixes: https://github.com/espressif/esp-idf/issues/975
This commit is contained in:
parent
9edf65d56e
commit
59a6800cdf
@ -26,6 +26,7 @@
|
||||
#include "soc/uart_struct.h"
|
||||
#include "soc/io_mux_reg.h"
|
||||
#include "soc/gpio_sig_map.h"
|
||||
#include "soc/dport_reg.h"
|
||||
|
||||
#define ETS_UART_INUM 5
|
||||
#define ETS_UART2_INUM ETS_UART_INUM
|
||||
@ -190,7 +191,13 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(uart_nr == 1){
|
||||
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_UART1_CLK_EN);
|
||||
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_UART1_RST);
|
||||
} 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);
|
||||
}
|
||||
uartFlush(uart);
|
||||
uartSetBaudRate(uart, baudrate);
|
||||
UART_MUTEX_LOCK();
|
||||
|
Loading…
Reference in New Issue
Block a user