forked from mirrors/qmk_firmware
make custom keycodes actually work
This commit is contained in:
parent
5b0b8ba654
commit
9eaee65ac3
2 changed files with 14 additions and 12 deletions
|
@ -52,19 +52,21 @@ def generate_layouts(cli):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if 'custom_keycodes' in kb_info_json:
|
if 'custom_keycodes' in kb_info_json:
|
||||||
|
layouts_h_lines.append('\n#ifndef __ASSEMBLER__')
|
||||||
layouts_h_lines.append('\n#include "quantum_keycodes.h"')
|
layouts_h_lines.append('\n#include "quantum_keycodes.h"')
|
||||||
#layouts_h_lines.append('\nenum custom_keycodes {')
|
layouts_h_lines.append('\nenum custom_keycodes {')
|
||||||
first = True
|
first = True
|
||||||
#for keycode in kb_info_json['custom_keycodes']:
|
for keycode in kb_info_json['custom_keycodes']:
|
||||||
# if first:
|
if first:
|
||||||
# first = False
|
first = False
|
||||||
# layouts_h_lines.append(f'\t{keycode} = SAFE_RANGE,')
|
layouts_h_lines.append(f'\t{keycode} = SAFE_RANGE,')
|
||||||
# else:
|
else:
|
||||||
# layouts_h_lines.append(f'\t{keycode},')
|
layouts_h_lines.append(f'\t{keycode},')
|
||||||
#layouts_h_lines.append('\tNEW_SAFE_RANGE')
|
layouts_h_lines.append('\tNEW_SAFE_RANGE')
|
||||||
#layouts_h_lines.append('}\n')
|
layouts_h_lines.append('};\n')
|
||||||
#layouts_h_lines.append('#undef SAFE_RANGE')
|
layouts_h_lines.append('#undef SAFE_RANGE')
|
||||||
#layouts_h_lines.append('#define SAFE_RANGE NEW_SAFE_RANGE')
|
layouts_h_lines.append('#define SAFE_RANGE NEW_SAFE_RANGE')
|
||||||
|
layouts_h_lines.append('#endif // __ASSEMBLER__')
|
||||||
|
|
||||||
for layout_name in kb_info_json['layouts']:
|
for layout_name in kb_info_json['layouts']:
|
||||||
if kb_info_json['layouts'][layout_name]['c_macro']:
|
if kb_info_json['layouts'][layout_name]['c_macro']:
|
||||||
|
|
|
@ -358,7 +358,7 @@ $1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG))
|
||||||
endif
|
endif
|
||||||
$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS)
|
$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS)
|
||||||
$1_CXXFLAGS = $$(ALL_CXXFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS)
|
$1_CXXFLAGS = $$(ALL_CXXFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS)
|
||||||
$1_ASFLAGS = $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS)
|
$1_ASFLAGS = $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS)
|
||||||
|
|
||||||
# Compile: create object files from C source files.
|
# Compile: create object files from C source files.
|
||||||
$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN)
|
$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN)
|
||||||
|
|
Loading…
Reference in a new issue