pragma once for keymap.h

This commit is contained in:
Devaev Maxim 2018-08-03 00:53:34 +03:00
parent 12f504482c
commit 4bacc04d2b
2 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,7 @@ def main() -> None:
}, kvmd_yaml_file, indent=4, default_flow_style=False) }, kvmd_yaml_file, indent=4, default_flow_style=False)
with open("src/keymap.h", "w") as hid_header_file: 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("#pragma once\n\n#include <HID-Project.h>\n\n#include \"inline.h\"\n\n\n")
hid_header_file.write("INLINE KeyboardKeycode 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)): 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\tcase %d: return %s;\n" % (code, hid_key))

View File

@ -1,3 +1,5 @@
#pragma once
#include <HID-Project.h> #include <HID-Project.h>
#include "inline.h" #include "inline.h"