diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-02-02 16:02:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-03 22:17:25 +0000 |
commit | cf69e095a410c95e74021ba274f1448765314e45 (patch) | |
tree | a04ce631fe3f39ee13c743041c18c6284e4077cb /include | |
parent | c0c728d22621d6364d4bd62053adce4acc9424aa (diff) | |
download | chrome-ec-cf69e095a410c95e74021ba274f1448765314e45.tar.gz |
zephyr: Support use of zephyr "dummy" consolestabilize-14498.B-main
Right now we only use the serial console in ec zephyr, however if you
want to check the output of a console command in a test, that is not
sufficient.
Add test only get_ec_shell() function that will give you the active
shell, whichever backend it might use.
Change console.c to setup the serial or dummy backends depending on
Kconfig.
Removed all calls to shell_backend_uart_get_ptr(), except for 1 in
console.c:init_ec_shell().
Switch test/drivers to SHELL_BACKEND_DUMMY.
Added some better failure logging in utils.c.
BRANCH=None
BUG=b:214256453
TEST=zmake testall
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Ibafc37cc4363d1f20a919fa5e38325bd6a071eec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3433630
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/console.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/console.h b/include/console.h index 09155c9696..ad2fbe92a2 100644 --- a/include/console.h +++ b/include/console.h @@ -32,6 +32,13 @@ void uart_shell_start(void); * the PD threads, but higher than the HOSTCMD thread. See shimmed_task_id.h */ void uart_shell_set_priority(int prio); + +#ifdef TEST_BUILD +/* Gets the pointer to the zephyr shell, since it might not always be + * the uart backend. + */ +const struct shell *get_ec_shell(void); +#endif #else static inline int uart_shell_stop(void) { |