From: Wangjialin Date: Thu, 26 Oct 2017 09:18:08 +0000 (+0800) Subject: bugfix(uart): Don't disable console UART peripheral X-Git-Tag: v3.1-dev~125^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=102eb96c8bf830295782983fcbce0415cf4b8dcd;p=esp-idf bugfix(uart): Don't disable console UART peripheral --- diff --git a/components/driver/uart.c b/components/driver/uart.c index 9ea92158cf..4a2a1640ea 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -1140,12 +1140,14 @@ esp_err_t uart_driver_delete(uart_port_t uart_num) free(p_uart_obj[uart_num]); p_uart_obj[uart_num] = NULL; - if(uart_num == UART_NUM_0) { - periph_module_disable(PERIPH_UART0_MODULE); - } else if(uart_num == UART_NUM_1) { - periph_module_disable(PERIPH_UART1_MODULE); - } else if(uart_num == UART_NUM_2) { - periph_module_disable(PERIPH_UART2_MODULE); + if (uart_num != CONFIG_CONSOLE_UART_NUM ) { + if(uart_num == UART_NUM_0) { + periph_module_disable(PERIPH_UART0_MODULE); + } else if(uart_num == UART_NUM_1) { + periph_module_disable(PERIPH_UART1_MODULE); + } else if(uart_num == UART_NUM_2) { + periph_module_disable(PERIPH_UART2_MODULE); + } } return ESP_OK; }