mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
Merge branch 'pr_17788_v6.1' into 'release/v6.1'
Add support for multiple console types in CLI (IDFGH-16697) (v6.1) See merge request espressif/esp-idf!52852
This commit is contained in:
@@ -51,8 +51,21 @@ void app_main(void)
|
|||||||
register_ieee802154_debug_cmd();
|
register_ieee802154_debug_cmd();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_ESP_CONSOLE_UART_DEFAULT) || defined(CONFIG_ESP_CONSOLE_UART_CUSTOM)
|
||||||
esp_console_dev_uart_config_t hw_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
|
esp_console_dev_uart_config_t hw_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
|
||||||
ESP_ERROR_CHECK(esp_console_new_repl_uart(&hw_config, &repl_config, &repl));
|
ESP_ERROR_CHECK(esp_console_new_repl_uart(&hw_config, &repl_config, &repl));
|
||||||
|
|
||||||
|
#elif defined(CONFIG_ESP_CONSOLE_USB_CDC)
|
||||||
|
esp_console_dev_usb_cdc_config_t hw_config = ESP_CONSOLE_DEV_CDC_CONFIG_DEFAULT();
|
||||||
|
ESP_ERROR_CHECK(esp_console_new_repl_usb_cdc(&hw_config, &repl_config, &repl));
|
||||||
|
|
||||||
|
#elif defined(CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG)
|
||||||
|
esp_console_dev_usb_serial_jtag_config_t hw_config = ESP_CONSOLE_DEV_USB_SERIAL_JTAG_CONFIG_DEFAULT();
|
||||||
|
ESP_ERROR_CHECK(esp_console_new_repl_usb_serial_jtag(&hw_config, &repl_config, &repl));
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error Unsupported console type
|
||||||
|
#endif
|
||||||
|
|
||||||
ESP_ERROR_CHECK(esp_console_start_repl(repl));
|
ESP_ERROR_CHECK(esp_console_start_repl(repl));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user