summaryrefslogtreecommitdiff
path: root/include/console.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/console.h')
-rw-r--r--include/console.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/console.h b/include/console.h
index 4a655387da..3ad4150fe4 100644
--- a/include/console.h
+++ b/include/console.h
@@ -8,6 +8,7 @@
#ifndef __CROS_EC_CONSOLE_H
#define __CROS_EC_CONSOLE_H
+#include "board.h"
#include "common.h"
/* Console command; used by DECLARE_CONSOLE_COMMAND macro. */
@@ -16,6 +17,12 @@ struct console_command {
const char *name;
/* Handler for the command. argv[0] will be the command name. */
int (*handler)(int argc, char **argv);
+#ifdef CONFIG_CONSOLE_CMDHELP
+ /* Description of args */
+ const char *argdesc;
+ /* Short help for command */
+ const char *shorthelp;
+#endif
};
@@ -80,10 +87,18 @@ void console_has_input(void);
* Register a console command handler. Note that `name' must never be a
* beginning of another existing command name.
*/
-#define DECLARE_CONSOLE_COMMAND(name, routine) \
- static const char __con_cmd_label_##name[] = #name; \
- const struct console_command __con_cmd_##name \
- __attribute__((section(".rodata.cmds." #name))) \
- = {__con_cmd_label_##name, routine}
+#ifdef CONFIG_CONSOLE_CMDHELP
+#define DECLARE_CONSOLE_COMMAND(name, routine, argdesc, shorthelp, longhelp) \
+ static const char __con_cmd_label_##name[] = #name; \
+ const struct console_command __con_cmd_##name \
+ __attribute__((section(".rodata.cmds." #name))) \
+ = {__con_cmd_label_##name, routine, argdesc, shorthelp}
+#else
+#define DECLARE_CONSOLE_COMMAND(name, routine, argdesc, shorthelp, longhelp) \
+ static const char __con_cmd_label_##name[] = #name; \
+ const struct console_command __con_cmd_##name \
+ __attribute__((section(".rodata.cmds." #name))) \
+ = {__con_cmd_label_##name, routine}
+#endif
#endif /* __CROS_EC_CONSOLE_H */