summaryrefslogtreecommitdiff
path: root/common/keyboard_scan.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-05-04 16:40:49 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-08 07:04:06 -0700
commit541ddb0f889c2630e457fbab475cf6e2f781b54c (patch)
tree93f07a7df2523b0ca60fcd72b2af3fd2b311d451 /common/keyboard_scan.c
parent8c26ccbc151e8e270e04af74719d5e4befcc8ff3 (diff)
downloadchrome-ec-541ddb0f889c2630e457fbab475cf6e2f781b54c.tar.gz
keyboard_scan: Add option to not handle special key combinations
On some boards, the special alt-volup-r/h combinations do not make a lot of sense, so we can just not process them and save a little bit of code space. BRANCH=none BUG=b:37422577 TEST=Flash hammer, alt-volup-r/h does not do anything special TEST=make newsizes shows we save 124 bytes in hammer RW. Change-Id: I92770fd6b8ff90780162a6b1de428a550bb44e9b Reviewed-on: https://chromium-review.googlesource.com/495967 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/keyboard_scan.c')
-rw-r--r--common/keyboard_scan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index fa8ce3d98f..3ad4805b90 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -272,6 +272,7 @@ static int read_matrix(uint8_t *state)
return pressed ? 1 : 0;
}
+#ifdef CONFIG_KEYBOARD_RUNTIME_KEYS
/**
* Check special runtime key combinations.
*
@@ -365,6 +366,7 @@ static int check_runtime_keys(const uint8_t *state)
return 0;
}
+#endif /* CONFIG_KEYBOARD_RUNTIME_KEYS */
/**
* Check for ghosting in the keyboard state.
@@ -506,9 +508,11 @@ static int check_keys_changed(uint8_t *state)
CPRINTF("]\n");
#endif
+#ifdef CONFIG_KEYBOARD_RUNTIME_KEYS
/* Swallow special keys */
if (check_runtime_keys(state))
return 0;
+#endif
#ifdef CONFIG_KEYBOARD_PROTOCOL_MKBP
keyboard_fifo_add(state);