mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(console): Add max_cmdline_args to esp_console_repl_config_t
This commit is contained in:
@@ -59,17 +59,23 @@ _exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t esp_console_common_init(size_t max_cmdline_length, esp_console_repl_com_t *repl_com)
|
||||
esp_err_t esp_console_common_init(size_t max_cmdline_length, size_t max_cmdline_args, esp_console_repl_com_t *repl_com)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
/* Initialize the console */
|
||||
esp_console_config_t console_config = ESP_CONSOLE_CONFIG_DEFAULT();
|
||||
repl_com->max_cmdline_length = console_config.max_cmdline_length;
|
||||
repl_com->max_cmdline_args = console_config.max_cmdline_args;
|
||||
/* Replace the default command line length if passed as a parameter */
|
||||
if (max_cmdline_length != 0) {
|
||||
console_config.max_cmdline_length = max_cmdline_length;
|
||||
repl_com->max_cmdline_length = max_cmdline_length;
|
||||
}
|
||||
/* Replace the default command line args if passed as a parameter */
|
||||
if (max_cmdline_args != 0) {
|
||||
console_config.max_cmdline_args = max_cmdline_args;
|
||||
repl_com->max_cmdline_args = max_cmdline_args;
|
||||
}
|
||||
|
||||
#if CONFIG_LOG_COLORS
|
||||
console_config.hint_color = atoi(LOG_COLOR_CYAN);
|
||||
|
||||
Reference in New Issue
Block a user