aboutsummaryrefslogtreecommitdiffstats
path: root/os/various/shell/shell_cmd.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-20 14:32:35 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-20 14:32:35 +0000
commit22a386b4540b2e5fd4249887e26fdd78a73b692c (patch)
tree23f2d67abd32f3a9fb2e7be05d66e1e88cc809c8 /os/various/shell/shell_cmd.c
parent27e1398be3821f814aee4eaf7627b2d8fb5c4934 (diff)
downloadChibiOS-22a386b4540b2e5fd4249887e26fdd78a73b692c.tar.gz
ChibiOS-22a386b4540b2e5fd4249887e26fdd78a73b692c.tar.bz2
ChibiOS-22a386b4540b2e5fd4249887e26fdd78a73b692c.zip
Shell enhancements.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8914 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various/shell/shell_cmd.c')
-rw-r--r--os/various/shell/shell_cmd.c15
1 files changed, 15 insertions, 0 deletions
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