diff options
author | Hung-Te Lin <hungte@chromium.org> | 2018-08-08 12:35:37 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-16 13:14:46 -0700 |
commit | 7ef6291e33c31388652e66ebf0f96ec6d836d528 (patch) | |
tree | 675b2d1f463df13a94ea3e7621b714009f4d83c7 /common/keyboard_8042_sharedlib.c | |
parent | 50e52e2182a09eb862e5a0b4cbb25d052c94364d (diff) | |
download | chrome-ec-7ef6291e33c31388652e66ebf0f96ec6d836d528.tar.gz |
keyboard: Change scan code magic values to enum.
The key codes are now always scan code set 2 so we can create a list of
scan codes and use them easily.
BUG=None
TEST=make buildall -j; boots properly
BRANCH=None
Change-Id: I1fdd7ab81bc13c97c4139afc19d71f5898e22f96
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1166743
Diffstat (limited to 'common/keyboard_8042_sharedlib.c')
-rw-r--r-- | common/keyboard_8042_sharedlib.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/common/keyboard_8042_sharedlib.c b/common/keyboard_8042_sharedlib.c index 0ea4dca792..513a27913d 100644 --- a/common/keyboard_8042_sharedlib.c +++ b/common/keyboard_8042_sharedlib.c @@ -76,20 +76,20 @@ uint8_t scancode_translate_set2_to_1(uint8_t code) } /* - * Button scancodes in code set 2. + * Button scan codes. * Must be in the same order as defined in keyboard_button_type. */ SHAREDLIB(const struct button_8042_t buttons_8042[] = { - {0xe037, 0}, /* Power */ - {0xe021, 1}, /* Volume Down */ - {0xe032, 1}, /* Volume Up */ - {0x0016, 1}, /* 1 */ - {0x001e, 1}, /* 2 */ - {0x0026, 1}, /* 3 */ - {0x0025, 1}, /* 4 */ - {0x002e, 1}, /* 5 */ - {0x0036, 1}, /* 6 */ - {0x003d, 1}, /* 7 */ - {0x003e, 1}, /* 8 */ + {SCANCODE_POWER, 0}, + {SCANCODE_VOLUME_DOWN, 1}, + {SCANCODE_VOLUME_UP, 1}, + {SCANCODE_1, 1}, + {SCANCODE_2, 1}, + {SCANCODE_3, 1}, + {SCANCODE_4, 1}, + {SCANCODE_5, 1}, + {SCANCODE_6, 1}, + {SCANCODE_7, 1}, + {SCANCODE_8, 1}, }); BUILD_ASSERT(ARRAY_SIZE(buttons_8042) == KEYBOARD_BUTTON_COUNT); |