summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-05-13 14:07:21 -0700
committerChromeBot <chrome-bot@google.com>2013-05-14 10:17:13 -0700
commit24beb9976a482c40cf5ad8302dcb2032dd5307d1 (patch)
tree5fb06007558b33d9ef22d8f440446630df5c24c1
parentfa9c222a7936a74a405cc254e1bdc7baa9cd65b2 (diff)
downloadchrome-ec-24beb9976a482c40cf5ad8302dcb2032dd5307d1.tar.gz
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>
-rw-r--r--common/keyboard_scan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index 4bc3c5deb0..95394272ed 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -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 */