From cb663eeca6f5f2924974b4c6798a64489a5cdacc Mon Sep 17 00:00:00 2001 From: flabbergast Date: Mon, 12 Oct 2015 09:46:48 +0100 Subject: [PATCH] Move declaration of keymap_config. Should really not declare variables in .h files - since it's included in different .c files, a proper linker then complains that the same variable is declared more than once (once for each .c file that the offending .h is included in). --- tmk_core/common/bootmagic.c | 1 + tmk_core/common/keymap.c | 3 +++ tmk_core/common/keymap.h | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c index 698693cb..08241f7d 100644 --- a/tmk_core/common/bootmagic.c +++ b/tmk_core/common/bootmagic.c @@ -10,6 +10,7 @@ #include "eeconfig.h" #include "bootmagic.h" +keymap_config_t keymap_config; void bootmagic(void) { diff --git a/tmk_core/common/keymap.c b/tmk_core/common/keymap.c index d227add8..876f5c82 100644 --- a/tmk_core/common/keymap.c +++ b/tmk_core/common/keymap.c @@ -24,6 +24,9 @@ along with this program. If not, see . #include "debug.h" #include "bootloader.h" +#ifdef BOOTMAGIC_ENABLE +extern keymap_config_t keymap_config; +#endif static action_t keycode_to_action(uint8_t keycode); diff --git a/tmk_core/common/keymap.h b/tmk_core/common/keymap.h index e1a6f992..659ea357 100644 --- a/tmk_core/common/keymap.h +++ b/tmk_core/common/keymap.h @@ -38,7 +38,6 @@ typedef union { bool nkro:1; }; } keymap_config_t; -keymap_config_t keymap_config; #endif