keycode aliases: work around ChibiOS ch.h include guard (#21497)

This commit is contained in:
Ryan 2023-07-31 09:35:06 +10:00 committed by GitHub
parent cc3bd728f0
commit f407d90598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,11 @@ def _generate_helpers(lines, keycodes):
def _generate_aliases(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('')
lines.append('// Aliases') lines.append('// Aliases')
for key, value in keycodes["aliases"].items(): for key, value in keycodes["aliases"].items():

View File

@ -27,6 +27,8 @@
#include "keycodes.h" #include "keycodes.h"
// clang-format off // clang-format off
#undef CH_H
// Aliases // Aliases
#define CH_SECT KC_GRV // § #define CH_SECT KC_GRV // §
#define CH_1 KC_1 // 1 #define CH_1 KC_1 // 1

View File

@ -27,6 +27,8 @@
#include "keycodes.h" #include "keycodes.h"
// clang-format off // clang-format off
#undef CH_H
// Aliases // Aliases
#define CH_SECT KC_GRV // § #define CH_SECT KC_GRV // §
#define CH_1 KC_1 // 1 #define CH_1 KC_1 // 1