From 22a386b4540b2e5fd4249887e26fdd78a73b692c Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 20 Feb 2016 14:32:35 +0000 Subject: Shell enhancements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8914 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/shell/shell_cmd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'os/various/shell/shell_cmd.c') diff --git a/os/various/shell/shell_cmd.c b/os/various/shell/shell_cmd.c index 1a8bba4a4..7d592286b 100644 --- a/os/various/shell/shell_cmd.c +++ b/os/various/shell/shell_cmd.c @@ -93,6 +93,18 @@ static void cmd_info(BaseSequentialStream *chp, int argc, char *argv[]) { } #endif +#if (SHELL_CMD_ECHO_ENABLED == TRUE) || defined(__DOXYGEN__) +static void cmd_echo(BaseSequentialStream *chp, int argc, char *argv[]) { + + (void)argv; + if (argc != 1) { + usage(chp, "echo \"message\""); + return; + } + chprintf(chp, "%s\r\n", argv[0]); +} +#endif + #if (SHELL_CMD_SYSTIME_ENABLED == TRUE) || defined(__DOXYGEN__) static void cmd_systime(BaseSequentialStream *chp, int argc, char *argv[]) { @@ -175,6 +187,9 @@ ShellCommand shell_local_commands[] = { #if SHELL_CMD_INFO_ENABLED == TRUE {"info", cmd_info}, #endif +#if SHELL_CMD_ECHO_ENABLED == TRUE + {"echo", cmd_echo}, +#endif #if SHELL_CMD_SYSTIME_ENABLED == TRUE {"systime", cmd_systime}, #endif -- cgit v1.2.3