From 7c589cd5b1df91824ad34111f24d3abedf67dc2c Mon Sep 17 00:00:00 2001 From: Marcelo Barros de Almeida Date: Wed, 29 Oct 2025 12:41:53 -0300 Subject: [PATCH] feat(802.15.4): Add support for multiple console types in CLI Refactored app_main to initialize the console REPL based on the selected configuration: UART, USB CDC, or USB Serial JTAG. This improves flexibility and allows the CLI to work with different hardware interfaces. --- .../ieee802154_cli/main/esp_ieee802154_cli.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/ieee802154/ieee802154_cli/main/esp_ieee802154_cli.c b/examples/ieee802154/ieee802154_cli/main/esp_ieee802154_cli.c index 70ee037e4a4..a1e4401854c 100644 --- a/examples/ieee802154/ieee802154_cli/main/esp_ieee802154_cli.c +++ b/examples/ieee802154/ieee802154_cli/main/esp_ieee802154_cli.c @@ -51,8 +51,21 @@ void app_main(void) register_ieee802154_debug_cmd(); #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_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)); }