From ce92dd27dfa2b60cf4443da5eb47c51d8c7170bf Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Tue, 4 Oct 2016 11:24:07 -0700 Subject: [PATCH] Use CONFIG_KEYBOARD_DEBUG for keyboard debug printf Remove keyboard printk like: KB wait/poll when not debugging keyboard. BUG=none BRANCH=none TEST=compile. Change-Id: I9743eab4597d2b661ae7b21c0aab4e1ffdcdb9a4 Signed-off-by: Gwendal Grignou Reviewed-on: https://chromium-review.googlesource.com/394068 --- common/keyboard_scan.c | 14 +++++++++++--- include/config.h | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index 3ed60a27a7..a364917b33 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -27,6 +27,14 @@ #define CPRINTF(format, args...) cprintf(CC_KEYSCAN, format, ## args) #define CPRINTS(format, args...) cprints(CC_KEYSCAN, format, ## args) +#ifdef CONFIG_KEYBOARD_DEBUG +#define CPUTS5(outstr) cputs(CC_KEYSCAN, outstr) +#define CPRINTS5(format, args...) cprints(CC_KEYBOARD, format, ## args) +#else +#define CPUTS5(outstr) +#define CPRINTS5(format, args...) +#endif + #define SCAN_TIME_COUNT 32 /* Number of last scan times to track */ /* If we're waiting for a scan to happen, we'll give it this long */ @@ -481,7 +489,7 @@ static int check_keys_changed(uint8_t *state) if (print_state_changes) print_state(state, "state"); -#ifdef PRINT_SCAN_TIMES +#ifdef CONFIG_KEYBOARD_PRINT_SCAN_TIMES /* Print delta times from now back to each previous scan */ CPRINTF("[%T kb deltaT"); for (i = 0; i < SCAN_TIME_COUNT; i++) { @@ -644,7 +652,7 @@ void keyboard_scan_task(void) while (1) { /* Enable all outputs */ - CPRINTS("KB wait"); + CPRINTS5("KB wait"); keyboard_raw_enable_interrupt(1); @@ -696,7 +704,7 @@ void keyboard_scan_task(void) force_poll = 0; /* Enter polling mode */ - CPRINTS("KB poll"); + CPRINTS5("KB poll"); keyboard_raw_enable_interrupt(0); keyboard_raw_drive_column(KEYBOARD_COLUMN_NONE); diff --git a/include/config.h b/include/config.h index fe3a18ff6e..33fef10bd0 100644 --- a/include/config.h +++ b/include/config.h @@ -1364,6 +1364,9 @@ */ #undef CONFIG_KEYBOARD_POST_SCAN_CLOCKS +/* Print keyboard scan time intervals. */ +#undef CONFIG_KEYBOARD_PRINT_SCAN_TIMES + /* * Call board-supplied keyboard_suppress_noise() function when the debounced * keyboard state changes. Some boards use this to send a signal to the audio