summaryrefslogtreecommitdiff
path: root/common/console_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/console_output.c')
-rw-r--r--common/console_output.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/console_output.c b/common/console_output.c
index 7354ea4392..01f60859a4 100644
--- a/common/console_output.c
+++ b/common/console_output.c
@@ -10,6 +10,7 @@
#include "usb_console.h"
#include "util.h"
+#ifdef CONFIG_CONSOLE_CHANNEL
/* Default to all channels active */
#ifndef CC_DEFAULT
#define CC_DEFAULT CC_ALL
@@ -34,6 +35,7 @@ static const char * const channel_names[] = {
BUILD_ASSERT(ARRAY_SIZE(channel_names) == CC_CHANNEL_COUNT);
/* ensure that we are not silently masking additional channels */
BUILD_ASSERT(CC_CHANNEL_COUNT <= 8*sizeof(uint32_t));
+#endif /* CONFIG_CONSOLE_CHANNEL */
/*****************************************************************************/
/* Channel-based console output */
@@ -42,9 +44,11 @@ int cputs(enum console_channel channel, const char *outstr)
{
int rv1, rv2;
+#ifdef CONFIG_CONSOLE_CHANNEL
/* Filter out inactive channels */
if (!(CC_MASK(channel) & channel_mask))
return EC_SUCCESS;
+#endif
rv1 = usb_puts(outstr);
rv2 = uart_puts(outstr);
@@ -57,9 +61,11 @@ int cprintf(enum console_channel channel, const char *format, ...)
int rv1, rv2;
va_list args;
+#ifdef CONFIG_CONSOLE_CHANNEL
/* Filter out inactive channels */
if (!(CC_MASK(channel) & channel_mask))
return EC_SUCCESS;
+#endif
usb_va_start(args, format);
rv1 = usb_vprintf(format, args);
@@ -77,9 +83,11 @@ int cprints(enum console_channel channel, const char *format, ...)
int r, rv;
va_list args;
+#ifdef CONFIG_CONSOLE_CHANNEL
/* Filter out inactive channels */
if (!(CC_MASK(channel) & channel_mask))
return EC_SUCCESS;
+#endif
rv = cprintf(channel, "[%T ");
@@ -107,6 +115,7 @@ void cflush(void)
/*****************************************************************************/
/* Console commands */
+#ifdef CONFIG_CONSOLE_CHANNEL
/* Set active channels */
static int command_ch(int argc, char **argv)
{
@@ -149,3 +158,4 @@ static int command_ch(int argc, char **argv)
DECLARE_CONSOLE_COMMAND(chan, command_ch,
"[ save | restore | <mask> ]",
"Save, restore, get or set console channel mask");
+#endif /* CONFIG_CONSOLE_CHANNEL */