diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-03-21 13:28:11 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-22 11:24:29 -0700 |
commit | 10ac310605b32bf7fbd6fc83066e72e1e70a803c (patch) | |
tree | f7784c6416902032d6fd49164f9e8c1fbc94aa85 /chip/stm32/keyboard_raw.c | |
parent | 743c05f01f8f2b19dbf565bee645076fff75c42d (diff) | |
download | chrome-ec-10ac310605b32bf7fbd6fc83066e72e1e70a803c.tar.gz |
Move keyboard dimension and key constants to keyboard_config.h
These were previously duplicated between multiple keyboard_scan.c and
board.c files, and there were a bunch of different constants #defined
to be 13.
BUG=chrome-os-partner:18360
BRANCH=none
TEST=compile all boards; test keyboard on spring and link
Change-Id: I91bf9d56d2a56ff25ff307ff10883ca87b6937e5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46165
Diffstat (limited to 'chip/stm32/keyboard_raw.c')
-rw-r--r-- | chip/stm32/keyboard_raw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chip/stm32/keyboard_raw.c b/chip/stm32/keyboard_raw.c index e6a3dc65eb..1c799ba894 100644 --- a/chip/stm32/keyboard_raw.c +++ b/chip/stm32/keyboard_raw.c @@ -8,10 +8,11 @@ * input and output entries in the board's gpio_list[]. Each set of inputs or * outputs must be listed in consecutive, increasing order so that scan loops * can iterate beginning at KB_IN00 or KB_OUT00 for however many GPIOs are - * utilized (KB_INPUTS or KB_OUTPUTS). + * utilized (KEYBOARD_ROWS or KEYBOARD_COLS). */ #include "gpio.h" +#include "keyboard_config.h" #include "keyboard_raw.h" #include "keyboard_scan.h" #include "registers.h" @@ -27,7 +28,7 @@ static void set_irq_mask(void) { int i; - for (i = GPIO_KB_IN00; i < GPIO_KB_IN00 + KB_INPUTS; i++) + for (i = GPIO_KB_IN00; i < GPIO_KB_IN00 + KEYBOARD_ROWS; i++) irq_mask |= gpio_list[i].mask; } @@ -100,7 +101,7 @@ int keyboard_raw_read_rows(void) int state = 0; uint16_t port_val = 0; - for (i = 0; i < KB_INPUTS; i++) { + for (i = 0; i < KEYBOARD_ROWS; i++) { port = gpio_list[GPIO_KB_IN00 + i].port; if (port != prev_port) { port_val = STM32_GPIO_IDR_OFF(port); |