examples/system/light_sleep: fix uart garbled output

This commit is contained in:
jingli 2022-07-11 16:49:58 +08:00
parent 2be35e400a
commit 3652792f9d

View File

@ -107,6 +107,10 @@ static esp_err_t uart_initialization(void)
//Install UART driver, and get the queue.
ESP_RETURN_ON_ERROR(uart_driver_install(EXAMPLE_UART_NUM, EXAMPLE_UART_BUF_SIZE, EXAMPLE_UART_BUF_SIZE, 20, &uart_evt_que, 0),
TAG, "Install uart failed");
if (EXAMPLE_UART_NUM == CONFIG_ESP_CONSOLE_UART_NUM) {
/* temp fix for uart garbled output, can be removed when IDF-5683 done */
ESP_RETURN_ON_ERROR(uart_wait_tx_idle_polling(EXAMPLE_UART_NUM), TAG, "Wait uart tx done failed");
}
ESP_RETURN_ON_ERROR(uart_param_config(EXAMPLE_UART_NUM, &uart_cfg), TAG, "Configure uart param failed");
ESP_RETURN_ON_ERROR(uart_set_pin(EXAMPLE_UART_NUM, EXAMPLE_UART_TX_IO_NUM, EXAMPLE_UART_RX_IO_NUM, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE),
TAG, "Configure uart gpio pins failed");