From ff09089137d52be9265374af134503943e5c4ad6 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 30 Aug 2022 19:37:15 +0200 Subject: [PATCH] console: pass esp_console_repl_universal_t pointer to the repl task For usb_serial_jtag REPL only, xTaskCreate was passing a pointer to esp_console_repl_com_t, while esp_console_repl_task was expecting a pointer to esp_console_repl_universal_t. The way the two structures are defined, this makes no difference, and the pointer values are the same. Still, this could potentially break in the future. (I am not sure what is the distinction between repl_com (common?) and repl_universal; it seems that `int uart_channel` could just as well be part of esp_console_repl_com_t; alternatively, as suggested in the previous commit, this structure could contain a callback function pointer, which would allow `esp_console_new_repl_*` functions to specify how stdin/stdout should be initialized by the REPL task.) --- components/console/esp_console_repl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/console/esp_console_repl.c b/components/console/esp_console_repl.c index d1baaccfbb..cb60df5452 100644 --- a/components/console/esp_console_repl.c +++ b/components/console/esp_console_repl.c @@ -181,7 +181,7 @@ esp_err_t esp_console_new_repl_usb_serial_jtag(const esp_console_dev_usb_serial_ /* spawn a single thread to run REPL */ if (xTaskCreate(esp_console_repl_task, "console_repl", repl_config->task_stack_size, - &usb_serial_jtag_repl->repl_com, repl_config->task_priority, &usb_serial_jtag_repl->repl_com.task_hdl) != pdTRUE) { + usb_serial_jtag_repl, repl_config->task_priority, &usb_serial_jtag_repl->repl_com.task_hdl) != pdTRUE) { ret = ESP_FAIL; goto _exit; }