summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-10-16 12:37:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-19 12:19:32 -0700
commit9fda2eea0861911537922ce3e45b118297f5030d (patch)
treec3d6822f5088ee561a2b0414300e3efb755e33d6 /chip
parent59dc8df73fa71f3064fd225cf89fed65bf1b25a9 (diff)
downloadchrome-ec-9fda2eea0861911537922ce3e45b118297f5030d.tar.gz
Keyboard: switch column and row of scancode table
This patch switches column and row of scancode_set2. That is, scancode_set2[ROWS][COLS] = {0x00, 0x01, 0x02, ..., 0x10, 0x11, ..., 0x20, ..., becomes scancode_set2[COLS][ROWS] = {0x00, 0x10, 0x20, ..., 0x01, 0x11, ..., 0x02, ..., This will allow us to extend the table for a keypad without losing too much readability. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:117126568 BRANCH=none TEST=Verify keyboard functionality on Sona. Change-Id: I49a7c0796d5c91989f1d3686c80743fb4bcd5ba7 Reviewed-on: https://chromium-review.googlesource.com/1285291 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/stm32/usb_hid_keyboard.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/chip/stm32/usb_hid_keyboard.c b/chip/stm32/usb_hid_keyboard.c
index f30eedde13..e177aa8ed7 100644
--- a/chip/stm32/usb_hid_keyboard.c
+++ b/chip/stm32/usb_hid_keyboard.c
@@ -116,24 +116,20 @@ struct usb_hid_keyboard_output_report {
*
* Assistant key is mapped as 0xf0, but this key code is never actually send.
*/
-const uint8_t keycodes[KEYBOARD_ROWS][KEYBOARD_COLS] = {
- { 0x00, 0xe3, 0x3a, 0x05, 0x43, 0x87, 0x11, 0x00, 0x2e,
- 0x00, 0xe6, 0x00, 0x00 },
- { 0x00, 0x29, 0x3d, 0x0a, 0x40, 0x00, 0x0b, 0x00, 0x34,
- 0x42, 0x00, 0x2a, 0x90 },
- { 0xe0, 0x2b, 0x3c, 0x17, 0x3f, 0x30, 0x1c, 0x64, 0x2F,
- 0x41, 0x89, 0x00, 0x00 },
- { 0xe3, 0x35, 0x3b, 0x22, 0x3e, 0x00, 0x23, 0x00, 0x2d,
- 0x68, 0x00, 0x31, 0x91 },
- { 0xe4, 0x04, 0x07, 0x09, 0x16, 0x0e, 0x0d, 0x00, 0x33,
- 0x0f, 0x31, 0x28, 0x00 },
- { HID_KEYBOARD_ASSISTANT_KEY,
- 0x1d, 0x06, 0x19, 0x1b, 0x36, 0x10, 0xe1, 0x38,
- 0x37, 0x00, 0x2c, 0x00 },
- { 0x00, 0x1e, 0x20, 0x21, 0x1f, 0x25, 0x24, 0x00, 0x27,
- 0x26, 0xe2, 0x51, 0x4f },
- { 0x00, 0x14, 0x08, 0x15, 0x1a, 0x0c, 0x18, 0xe5, 0x13,
- 0x12, 0x00, 0x52, 0x50 }
+const uint8_t keycodes[KEYBOARD_COLS][KEYBOARD_ROWS] = {
+ {0x00, 0x00, 0xe0, 0xe3, 0xe4, HID_KEYBOARD_ASSISTANT_KEY, 0x00, 0x00},
+ {0xe3, 0x29, 0x2b, 0x35, 0x04, 0x1d, 0x1e, 0x14},
+ {0x3a, 0x3d, 0x3c, 0x3b, 0x07, 0x06, 0x20, 0x08},
+ {0x05, 0x0a, 0x17, 0x22, 0x09, 0x19, 0x21, 0x15},
+ {0x43, 0x40, 0x3f, 0x3e, 0x16, 0x1b, 0x1f, 0x1a},
+ {0x87, 0x00, 0x30, 0x00, 0x0e, 0x36, 0x25, 0x0c},
+ {0x11, 0x0b, 0x1c, 0x23, 0x0d, 0x10, 0x24, 0x18},
+ {0x00, 0x00, 0x64, 0x00, 0x00, 0xe1, 0x00, 0xe5},
+ {0x2e, 0x34, 0x2F, 0x2d, 0x33, 0x38, 0x27, 0x13},
+ {0x00, 0x42, 0x41, 0x68, 0x0f, 0x37, 0x26, 0x12},
+ {0xe6, 0x00, 0x89, 0x00, 0x31, 0x00, 0xe2, 0x00},
+ {0x00, 0x2a, 0x00, 0x31, 0x28, 0x2c, 0x51, 0x52},
+ {0x00, 0x90, 0x00, 0x91, 0x00, 0x00, 0x4f, 0x50},
};
/* HID descriptors */