summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoebius.ever <[email protected]>2018-03-15 12:13:40 +0800
committermoebius.ever <[email protected]>2018-03-15 12:13:40 +0800
commit48ecbd3999bfdab6fbfbb3b07c5c5a44a9ec4d02 (patch)
treeff8084effe83877a148724855c607c6597a677c2
parent3e7501113fa90394bad7ec9b63a97b650d7cf559 (diff)
[finsh] add FINSH_ECHO_MODE_DEFAULT, to config the default echo mode of finsh
-rw-r--r--components/finsh/Kconfig6
-rw-r--r--components/finsh/shell.c6
-rw-r--r--components/finsh/shell.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/components/finsh/Kconfig b/components/finsh/Kconfig
index f3931c68b7..7345afbe86 100644
--- a/components/finsh/Kconfig
+++ b/components/finsh/Kconfig
@@ -26,9 +26,9 @@ config FINSH_USING_DESCRIPTION
bool "Keeping description in symbol table"
default y
-config FINSH_ENABLE_ECHO
- int "Enble the command echo mode"
- default 1
+config FINSH_ECHO_MODE_DEFAULT
+ bool "Enble the command echo mode or not in default"
+ default y
config FINSH_THREAD_PRIORITY
int "The priority level value of finsh thread"
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index a98c2531b5..7f2d7c07bc 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -414,7 +414,11 @@ void finsh_thread_entry(void *parameter)
char ch;
/* normal is echo mode */
- shell->echo_mode = FINSH_ENABLE_ECHO;
+#ifdef FINSH_ECHO_MODE_DEFAULT
+ shell->echo_mode = 1;
+#else
+ shell->echo_mode = 0;
+#endif
#ifndef FINSH_USING_MSH_ONLY
finsh_init(&shell->parser);
diff --git a/components/finsh/shell.h b/components/finsh/shell.h
index 21b67ba8cb..06b81de518 100644
--- a/components/finsh/shell.h
+++ b/components/finsh/shell.h
@@ -57,10 +57,6 @@ const char* finsh_get_prompt(void);
#endif
#endif
-#ifndef FINSH_ENABLE_ECHO
-#define FINSH_ENABLE_ECHO 1
-#endif
-
#ifdef FINSH_USING_AUTH
#ifndef FINSH_PASSWORD_MAX
#define FINSH_PASSWORD_MAX RT_NAME_MAX