diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-11-19 12:07:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-22 21:20:45 +0000 |
commit | 913e9a7541671f08957deeb916dea39ee457f8ef (patch) | |
tree | e77ab5a47112daef190192a1e84d9b755659326a | |
parent | 961062d7f72dd5b2bee75c013f03d7c0a47291bf (diff) | |
download | chrome-ec-913e9a7541671f08957deeb916dea39ee457f8ef.tar.gz |
zephyr: console: Use shell backend config struct for main branch
The Zephyr main branch introduced a new config struct we need to use
for setting up the shell (PR #38384). Detect the change and use the
new API when on the main branch.
BUG=b:205884929
BRANCH=none
TEST=compiles further on main branch (still a few more unrelated
issues to resolve)
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Ia4723d42b6220cd934970bf0c1dff5b93ccc6cf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3296531
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/shim/src/console.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c index 5a465b2fd4..ef5e20687a 100644 --- a/zephyr/shim/src/console.c +++ b/zephyr/shim/src/console.c @@ -109,6 +109,14 @@ int uart_shell_stop(void) return event.signal->result; } +#ifdef SHELL_DEFAULT_BACKEND_CONFIG_FLAGS +static const struct shell_backend_config_flags shell_cfg_flags = + SHELL_DEFAULT_BACKEND_CONFIG_FLAGS; +#else +/* TODO(b/205884929): Drop after we drop support for v2.7 */ +static const bool shell_cfg_flags; +#endif + static void shell_init_from_work(struct k_work *work) { bool log_backend = CONFIG_SHELL_BACKEND_SERIAL_LOG_LEVEL > 0; @@ -122,8 +130,8 @@ static void shell_init_from_work(struct k_work *work) } /* Initialize the shell and re-enable both RX and TX */ - shell_init(shell_backend_uart_get_ptr(), uart_shell_dev, false, - log_backend, level); + shell_init(shell_backend_uart_get_ptr(), uart_shell_dev, + shell_cfg_flags, log_backend, level); uart_irq_rx_enable(uart_shell_dev); uart_irq_tx_enable(uart_shell_dev); |