From 9d466de235174604912023f053dedaf3c7baee28 Mon Sep 17 00:00:00 2001 From: Wangjialin Date: Thu, 20 Jul 2017 14:34:11 +0800 Subject: [PATCH] bugfix(uart): fix signal glitch on tx pin gpio_matrix_out function will set output enable for GPIO, seems in gpio_matrix_out there will be a short moment that the chip will output GPIO level. So we can set GPIO as high before gpio_matrix_out function. --- components/driver/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/uart.c b/components/driver/uart.c index 30c3b7e57f..976efda3d0 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -394,7 +394,7 @@ esp_err_t uart_set_pin(uart_port_t uart_num, int tx_io_num, int rx_io_num, int r } if(tx_io_num >= 0) { PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[tx_io_num], PIN_FUNC_GPIO); - gpio_set_direction(tx_io_num, GPIO_MODE_OUTPUT); + gpio_set_level(tx_io_num, 1); gpio_matrix_out(tx_io_num, tx_sig, 0, 0); } -- 2.40.0