Skip to content

Commit

Permalink
keycode aliases: work around ChibiOS ch.h include guard (qmk#21497)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark committed Jul 30, 2023
1 parent cc3bd72 commit f407d90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/python/qmk/cli/generate/keycodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def _generate_helpers(lines, keycodes):


def _generate_aliases(lines, keycodes):
# Work around ChibiOS ch.h include guard
if 'CH_H' in [value['key'] for value in keycodes['aliases'].values()]:
lines.append('')
lines.append('#undef CH_H')

lines.append('')
lines.append('// Aliases')
for key, value in keycodes["aliases"].items():
Expand Down
2 changes: 2 additions & 0 deletions quantum/keymap_extras/keymap_swiss_de.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "keycodes.h"
// clang-format off

#undef CH_H

// Aliases
#define CH_SECT KC_GRV // §
#define CH_1 KC_1 // 1
Expand Down
2 changes: 2 additions & 0 deletions quantum/keymap_extras/keymap_swiss_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "keycodes.h"
// clang-format off

#undef CH_H

// Aliases
#define CH_SECT KC_GRV // §
#define CH_1 KC_1 // 1
Expand Down

0 comments on commit f407d90

Please sign in to comment.