diff options
author | Devaev Maxim <[email protected]> | 2018-07-11 06:30:47 +0000 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-11 06:30:47 +0000 |
commit | f0c78e966ea1e1faf9206c47f254fe3f38ba1f34 (patch) | |
tree | 90defde77b08c4127aaab98d1eaace7434c26738 /hid/src | |
parent | 08a36a1fe0c0844df425566596f0f016eef677b8 (diff) |
fixed keymapping
Diffstat (limited to 'hid/src')
-rw-r--r-- | hid/src/inline.h | 2 | ||||
-rw-r--r-- | hid/src/keymap.h | 4 | ||||
-rw-r--r-- | hid/src/main.cpp | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/hid/src/inline.h b/hid/src/inline.h index 25e50329..5b642a83 100644 --- a/hid/src/inline.h +++ b/hid/src/inline.h @@ -1 +1,3 @@ +#pragma once + #define INLINE inline __attribute__((always_inline)) diff --git a/hid/src/keymap.h b/hid/src/keymap.h index be393625..675d0b2f 100644 --- a/hid/src/keymap.h +++ b/hid/src/keymap.h @@ -3,7 +3,7 @@ #include "inline.h" -INLINE uint8_t keymap(uint8_t code) { +INLINE KeyboardKeycode keymap(uint8_t code) { switch(code) { case 36: return KEY_0; case 27: return KEY_1; @@ -91,4 +91,4 @@ INLINE uint8_t keymap(uint8_t code) { case 26: return KEY_Z; default: return 0; } -}
\ No newline at end of file +} diff --git a/hid/src/main.cpp b/hid/src/main.cpp index 631925f0..ba26be5c 100644 --- a/hid/src/main.cpp +++ b/hid/src/main.cpp @@ -19,7 +19,7 @@ INLINE void cmdResetHid() { INLINE void cmdKeyEvent() { uint8_t state = CMD_SERIAL.read(); - uint8_t code = keymap(CMD_SERIAL.read()); + KeyboardKeycode code = keymap((uint8_t)CMD_SERIAL.read()); CMD_SERIAL.read(); // unused now if (code) { if (state) { |