summaryrefslogtreecommitdiff
path: root/hid/src
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-13 06:34:32 +0000
committerDevaev Maxim <[email protected]>2018-07-13 06:34:32 +0000
commit65b3bd8866f86a01fd700e308908f02684a36660 (patch)
tree36e858d700feef945ed12bd46fa4287a9f4dc784 /hid/src
parent30f7fc052e3a231abb6b1f1aabeb71172a6ccd9b (diff)
hid: using KEY_ERROR_UNDEFINED instead of 0
Diffstat (limited to 'hid/src')
-rw-r--r--hid/src/keymap.h2
-rw-r--r--hid/src/main.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/hid/src/keymap.h b/hid/src/keymap.h
index 675d0b2f..7e5f24b7 100644
--- a/hid/src/keymap.h
+++ b/hid/src/keymap.h
@@ -89,6 +89,6 @@ INLINE KeyboardKeycode keymap(uint8_t code) {
case 24: return KEY_X;
case 25: return KEY_Y;
case 26: return KEY_Z;
- default: return 0;
+ default: return KEY_ERROR_UNDEFINED;
}
}
diff --git a/hid/src/main.cpp b/hid/src/main.cpp
index ba26be5c..98faff25 100644
--- a/hid/src/main.cpp
+++ b/hid/src/main.cpp
@@ -20,8 +20,7 @@ INLINE void cmdResetHid() {
INLINE void cmdKeyEvent() {
uint8_t state = CMD_SERIAL.read();
KeyboardKeycode code = keymap((uint8_t)CMD_SERIAL.read());
- CMD_SERIAL.read(); // unused now
- if (code) {
+ if (code != KEY_ERROR_UNDEFINED) {
if (state) {
Keyboard.press(code);
} else {