summaryrefslogtreecommitdiff
path: root/common/keyboard_test.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-10-16 15:16:29 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-19 23:21:56 -0700
commit9a890ad22965daa7e9365a0b2cb8c734ae41a842 (patch)
tree27e3f1f0845031e685fc46ffdad44d8cb87adfeb /common/keyboard_test.c
parent4d4d8f06e91090336c2eb29ee00ca86fea2bb796 (diff)
downloadchrome-ec-9a890ad22965daa7e9365a0b2cb8c734ae41a842.tar.gz
Keyboard: Allow keyboard size to be set at run time
Currently, the keyboard size (i.e. number of columns) is static. This patch allows it to be configured at run time. It's required to support a keyboard with/without keypad in a single image. KEYBOARD_COLS_MAX has the build time col size. It's used to allocate exact spaces for arrays. Actual keyboard scanning is done using keyboard_cols, which holds a runtime col size. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:117126568 BRANCH=none TEST=Verify keyboard functionality on Sona and Veyron. Change-Id: I4b3552be0b4b315c3fe5a6884cf25e10aba8be7c Reviewed-on: https://chromium-review.googlesource.com/1285292 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/keyboard_test.c')
-rw-r--r--common/keyboard_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/keyboard_test.c b/common/keyboard_test.c
index 580d4745cf..fee7d6db69 100644
--- a/common/keyboard_test.c
+++ b/common/keyboard_test.c
@@ -78,7 +78,7 @@ uint8_t keyscan_seq_get_scan(int column, uint8_t scan)
int c;
scan = 0;
- for (c = 0; c < KEYBOARD_COLS; c++)
+ for (c = 0; c < keyboard_cols; c++)
scan |= item->scan[c];
} else {
scan = item->scan[column];