summaryrefslogtreecommitdiff
path: root/include/console.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-23 16:18:32 -0700
committerGerrit <chrome-bot@google.com>2012-10-24 12:55:46 -0700
commitdc53e4db7fb2586ca3429ffb30d223de769e0c57 (patch)
tree8b1aa66aa6b446cd13be06f0b51e1f8e9d771800 /include/console.h
parente9dd3ff1ad69fa8780497b6075570acea489ffdd (diff)
downloadchrome-ec-dc53e4db7fb2586ca3429ffb30d223de769e0c57.tar.gz
Clean up console module
Code cleanup and reformatting. No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=compile code; type a debug command like 'help list'. Change-Id: I641215ba3333628f658eec86d9d99718c43b111f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36387
Diffstat (limited to 'include/console.h')
-rw-r--r--include/console.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/include/console.h b/include/console.h
index 0fb8b48771..f037b252ae 100644
--- a/include/console.h
+++ b/include/console.h
@@ -8,7 +8,6 @@
#ifndef __CROS_EC_CONSOLE_H
#define __CROS_EC_CONSOLE_H
-#include "board.h"
#include "common.h"
/* Console command; used by DECLARE_CONSOLE_COMMAND macro. */
@@ -25,7 +24,6 @@ struct console_command {
#endif
};
-
/* Console channels */
enum console_channel {
CC_COMMAND = 0, /* Console command (interactive I/O). Use this only
@@ -61,16 +59,29 @@ enum console_channel {
/* Mask to use to enable all channels */
#define CC_ALL 0xffffffffUL
-
-/* Put a string to the console channel. */
+/**
+ * Put a string to the console channel.
+ *
+ * @param channel Output chanel
+ * @param outstr String to write
+ *
+ * @return non-zero if output was truncated.
+ */
int cputs(enum console_channel channel, const char *outstr);
-/* Print formatted output to the console channel.
+/**
+ * Print formatted output to the console channel.
+ *
+ * @param channel Output chanel
+ * @param format Format string; see printf.h for valid formatting codes
*
- * See printf.h for valid formatting codes. */
+ * @return non-zero if output was truncated.
+ */
int cprintf(enum console_channel channel, const char *format, ...);
-/* Flush the console output for all channels. */
+/**
+ * Flush the console output for all channels.
+ */
void cflush(void);
/* Convenience macros for printing to the command channel.
@@ -82,14 +93,22 @@ void cflush(void);
* http://gcc.gnu.org/onlinedocs/gcc/Variadic-Macros.html */
#define ccprintf(format, args...) cprintf(CC_COMMAND, format, ## args)
-
-/* Called by UART when a line of input is pending. */
+/**
+ * Called by UART when a line of input is pending.
+ */
void console_has_input(void);
-
-/*
- * Register a console command handler. Note that `name' must never be a
- * beginning of another existing command name.
+/**
+ * Register a console command handler.
+ *
+ * @param name Command name; must not be the beginning of another
+ * existing command name. Note this is NOT in quotes
+ * so it can be concatenated to form a struct name.
+ * @param routine Command handling routine, of the form
+ * int handler(int argc, char **argv)
+ * @param argdesc String describing arguments to command; NULL if none.
+ * @param shorthelp String with one-line description of command.
+ * @param longhelp String with long description of command.
*/
#ifdef CONFIG_CONSOLE_CMDHELP
#define DECLARE_CONSOLE_COMMAND(name, routine, argdesc, shorthelp, longhelp) \