diff options
Diffstat (limited to 'hid')
-rwxr-xr-x | hid/genmap.py | 4 | ||||
-rw-r--r-- | hid/platformio.ini | 2 | ||||
-rw-r--r-- | hid/src/inline.h | 2 | ||||
-rw-r--r-- | hid/src/keymap.h | 4 | ||||
-rw-r--r-- | hid/src/main.cpp | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/hid/genmap.py b/hid/genmap.py index fe65d449..2e3183a8 100755 --- a/hid/genmap.py +++ b/hid/genmap.py @@ -26,10 +26,10 @@ def main() -> None: with open("src/keymap.h", "w") as hid_header_file: hid_header_file.write("#include <HID-Project.h>\n\n#include \"inline.h\"\n\n\n") - hid_header_file.write("INLINE uint8_t keymap(uint8_t code) {\n\tswitch(code) {\n") + hid_header_file.write("INLINE KeyboardKeycode keymap(uint8_t code) {\n\tswitch(code) {\n") for (code, hid_key, _) in sorted(keymap, key=operator.itemgetter(1)): hid_header_file.write("\t\tcase %d: return %s;\n" % (code, hid_key)) - hid_header_file.write("\t\tdefault: return 0;\n\t}\n}") + hid_header_file.write("\t\tdefault: return 0;\n\t}\n}\n") if __name__ == "__main__": diff --git a/hid/platformio.ini b/hid/platformio.ini index dbbb9c3e..bdea6e7f 100644 --- a/hid/platformio.ini +++ b/hid/platformio.ini @@ -16,4 +16,4 @@ upload_port = /dev/ttyACM0 monitor_baud = 115200 lib_deps = - HID-Project 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) { |