summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJes B. Klinke <jbk@chromium.org>2021-10-07 16:21:34 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-12 19:46:06 +0000
commit6c81234074add3ee421982ca7062b6d9805c7c15 (patch)
treeff1528b8b073d2188b5766f01f3516c80975063d
parentde2867d298194743d4f8776d43430e2556b5d5bf (diff)
downloadchrome-ec-6c81234074add3ee421982ca7062b6d9805c7c15.tar.gz
common/console: No PROMPT if CONFIG_EXPERIMENTAL_CONSOLE
The existing CONFIG_EXPERIMENTAL_CONSOLE shifts responsibility of command line editing and history away from the EC. As a part of that change, the EC should not emit the prompt character ">". It seems that every instance but one had already been enclosed in ifdef. This CL will take care of that last one, as well as make sure that PROMPT and CTRL are not defined when CONFIG_EXPERIMENTAL_CONSOLE is enabled, allowing the compiler to prevent any regressions. BUG=none BRANCH=none TEST=build servo_micro with CONFIG_EXPERIMENTAL_CONSOLE enabled Signed-off-by: Jes B. Klinke <jbk@chromium.org> Change-Id: Ifdab902cf877c7adee3d8e564cd234ffb19e317b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213360 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--common/console.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/console.c b/common/console.c
index 51f7a0bf38..dc0d2655c0 100644
--- a/common/console.c
+++ b/common/console.c
@@ -19,16 +19,18 @@
#define MAX_ARGS_PER_COMMAND 10
-#define PROMPT "> "
-
#ifdef CONFIG_EXPERIMENTAL_CONSOLE
#define EC_SYN 0xEC
#define EC_ACK 0xC0
-#endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */
+#else /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */
+
+#define PROMPT "> "
/* ASCII control character; for example, CTRL('C') = ^C */
#define CTRL(c) ((c) - '@')
+#endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */
+
#ifdef CONFIG_CONSOLE_HISTORY
/* History buffers */
static char history[CONFIG_CONSOLE_HISTORY][CONFIG_CONSOLE_INPUT_LINE_SIZE];
@@ -274,8 +276,8 @@ static void console_init(void)
ccprintf("Enhanced Console is enabled (v1.0.0); type HELP for help.\n");
#else
ccprintf("Console is enabled; type HELP for help.\n");
-#endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */
ccputs(PROMPT);
+#endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */
}
static int console_putc(int c)