diff options
author | Fabio Baltieri <fabiobaltieri@google.com> | 2021-02-19 15:24:20 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-04 12:18:41 +0000 |
commit | 723d411da02ce6e0de7f901c1f91a774a1adf19c (patch) | |
tree | ee73231ad33dfdec032fe0b3f7d9193637688160 /common/chargen.c | |
parent | 894a02b53b56f54094222d3acf701f44ed49ba41 (diff) | |
download | chrome-ec-723d411da02ce6e0de7f901c1f91a774a1adf19c.tar.gz |
zephyr: Add chargen command support
This adds support for the chargen command. The command is used to test
the console output to verify that no data has been lost. To do that, it
uses the low level UART APIs, so the normal shell operation is
temporarily suspended while the command is running.
BRANCH=none
BUG=b:177604307
TEST=tested the command in both zerphyr and ECOS builds
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: I7e41902ab7d841ebb7b9e14c52337ad18e10ad7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2707104
Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'common/chargen.c')
-rw-r--r-- | common/chargen.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/chargen.c b/common/chargen.c index 24e30bb878..1a57e7f539 100644 --- a/common/chargen.c +++ b/common/chargen.c @@ -68,6 +68,8 @@ static int command_chargen(int argc, char **argv) } #endif + uart_shell_stop(); + c = '0'; prev_watchdog_time = get_time(); while (uart_getc() != 'x' && usb_getc() != 'x') { @@ -90,6 +92,9 @@ static int command_chargen(int argc, char **argv) prev_watchdog_time.val = current_time.val; } + if (IS_ENABLED(CONFIG_ZEPHYR) && c == '0') + watchdog_reload(); + putc_(c++); if (seq_number && (++seq_counter == seq_number)) @@ -110,6 +115,9 @@ static int command_chargen(int argc, char **argv) } putc_('\n'); + + uart_shell_start(); + return EC_SUCCESS; } DECLARE_SAFE_CONSOLE_COMMAND(chargen, command_chargen, |