summaryrefslogtreecommitdiff
path: root/common/keyboard_scan.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-10-04 11:24:07 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-08 01:04:45 -0700
commitce92dd27dfa2b60cf4443da5eb47c51d8c7170bf (patch)
tree00e3c54250604abb6e5ada114af9ccc1e63dc13e /common/keyboard_scan.c
parent473ecbe2b36bc44da2552cd5814874a495913fc1 (diff)
downloadchrome-ec-ce92dd27dfa2b60cf4443da5eb47c51d8c7170bf.tar.gz
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 <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/394068
Diffstat (limited to 'common/keyboard_scan.c')
-rw-r--r--common/keyboard_scan.c14
1 files changed, 11 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);