mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(stdio): add console input ability when selects ESP_CONSOLE_UART_CUSTOM_NUM_1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2020-2026 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -63,8 +63,9 @@ void bootloader_console_init(void)
|
|||||||
const int uart_tx_gpio = (CONFIG_ESP_CONSOLE_UART_TX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_TX_GPIO : U0TXD_GPIO_NUM;
|
const int uart_tx_gpio = (CONFIG_ESP_CONSOLE_UART_TX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_TX_GPIO : U0TXD_GPIO_NUM;
|
||||||
const int uart_rx_gpio = (CONFIG_ESP_CONSOLE_UART_RX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_RX_GPIO : U0RXD_GPIO_NUM;
|
const int uart_rx_gpio = (CONFIG_ESP_CONSOLE_UART_RX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_RX_GPIO : U0RXD_GPIO_NUM;
|
||||||
|
|
||||||
// Switch to the new UART (this just changes UART number used for esp_rom_printf in ROM code).
|
// Switch to the new UART
|
||||||
esp_rom_output_set_as_console(uart_num);
|
esp_rom_output_set_as_console(uart_num); // changes UART number used for esp_rom_printf in ROM code
|
||||||
|
esp_rom_output_switch_buffer(uart_num);
|
||||||
|
|
||||||
// If console is attached to UART1 or if non-default pins are used,
|
// If console is attached to UART1 or if non-default pins are used,
|
||||||
// need to reconfigure pins using GPIO matrix
|
// need to reconfigure pins using GPIO matrix
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
|
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
|
||||||
|
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1=y
|
||||||
|
|||||||
@@ -264,6 +264,9 @@ void ESP_SYSTEM_IRAM_ATTR call_start_cpu1(void)
|
|||||||
#elif !CONFIG_ESP_CONSOLE_USB_CDC
|
#elif !CONFIG_ESP_CONSOLE_USB_CDC
|
||||||
esp_rom_install_uart_printf();
|
esp_rom_install_uart_printf();
|
||||||
esp_rom_output_set_as_console(CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM);
|
esp_rom_output_set_as_console(CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM);
|
||||||
|
#if CONFIG_ESP_CONSOLE_UART_CUSTOM
|
||||||
|
esp_rom_output_switch_buffer(CONFIG_ESP_CONSOLE_UART_NUM);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cpu_utility_ll_enable_debug(1);
|
cpu_utility_ll_enable_debug(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user