do not store the keyboard state on the stack

As our stack for the keyboard scanning task might be small (256 bytes on
STM32), we store the full keyboard state in a global instead of the
stack to avoid consuming 16 bytes there.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:19389
TEST=run on Spring with CONFIG_OVERFLOW_DETECT and see that the KEYSCAN task
is now consuming 248 bytes of stack instead of 264.

Change-Id: I2dd7815f36e6807e7b9e88d59f8fd8a14b1988ab
Reviewed-on: https://gerrit.chromium.org/gerrit/51028
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2013-05-13 14:07:21 -07:00
committed by ChromeBot
parent fa9c222a79
commit 24beb9976a

View File

@@ -274,7 +274,7 @@ static int check_keys_changed(uint8_t *state)
int any_pressed = 0;
int c, i;
int any_change = 0;
uint8_t new_state[KEYBOARD_COLS];
static uint8_t new_state[KEYBOARD_COLS];
uint32_t tnow = get_time().le.lo;
/* Save the current scan time */