summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/generate/config_h.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/cli/generate/config_h.py')
-rwxr-xr-xlib/python/qmk/cli/generate/config_h.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py
index 64d4db6ffe..828785ea48 100755
--- a/lib/python/qmk/cli/generate/config_h.py
+++ b/lib/python/qmk/cli/generate/config_h.py
@@ -15,7 +15,12 @@ from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE
def generate_define(define, value=None):
+ is_keymap = cli.args.filename
value = f' {value}' if value is not None else ''
+ if is_keymap:
+ return f"""
+#undef {define}
+#define {define}{value}"""
return f"""
#ifndef {define}
# define {define}{value}