diff options
author | Yuval Peress <peress@chromium.org> | 2021-02-26 11:01:00 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-26 21:47:02 +0000 |
commit | 6719c67cd4d81be791e231ba8e495a67fc482edc (patch) | |
tree | d32eb907ef2baef25e4ea0ac10f455c2dcb6ad49 /include/console.h | |
parent | 6c2c8963fcf9973bc67ba784f5a5e0b82c3ecbf4 (diff) | |
download | chrome-ec-6719c67cd4d81be791e231ba8e495a67fc482edc.tar.gz |
zephyr: console: add functions to enable/disable the shell
Adds functions that will allow us to temporarily take over the uart
from the shell. Note that for platform/ec code without Zephyr, these
functions are stubs so they are safe to call from common code, though
we'll most likely need other logic (such as turning off the console
task). This isn't done in these functions because the Zephyr shell
behaves differently from the task and in the example of efs2 needs to
be turned off earlier than the platform/ec console task.
BRANCH=none
BUG=b:164421798
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I75fc8fe2ca9214f216561ded97818880dda247d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2723495
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Diffstat (limited to 'include/console.h')
-rw-r--r-- | include/console.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/console.h b/include/console.h index 47c2113ec3..f517d3e074 100644 --- a/include/console.h +++ b/include/console.h @@ -16,6 +16,25 @@ #endif /* + * Define uart_shell_stop() and uart_shell_start() functions to start/stop the + * running shell. To avoid having a guard on the build type, non-Zephyr builds + * will have a stubbed function for these which is safe to call. These functions + * will stop/start the Zephyr shell from processing, they should be used for + * briefly taking control of the uart. + */ +#ifdef CONFIG_ZEPHYR +void uart_shell_stop(void); +void uart_shell_start(void); +#else +static inline void uart_shell_stop(void) +{ +} +static inline void uart_shell_start(void) +{ +} +#endif + +/* * The EC code base has been using %h to print a hex buffer. Encode the * parameters to do that in a pointer to a structure that's passed as the * printf argument. This is done rather than something like %.123ph because |