summaryrefslogtreecommitdiff
path: root/tmk_core/common.mk
diff options
context:
space:
mode:
authorAlex Ong <the.onga@gmail.com>2019-01-04 19:39:14 +1100
committerAlex Ong <the.onga@gmail.com>2019-01-04 19:39:14 +1100
commit47c91fc7f75ae0a477e55b687aa0fc30da0a283c (patch)
tree65ad39452748ff2e6d4a83ce54ede6ca22c9ada9 /tmk_core/common.mk
parentac9b88e8ccbbf38762871504cd827ff0d941c426 (diff)
parent563ce3f225d981ce460c12ca5130dfe47af41df0 (diff)
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'tmk_core/common.mk')
-rw-r--r--tmk_core/common.mk58
1 files changed, 56 insertions, 2 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 3e407f1573..063115acb1 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -3,6 +3,8 @@ ifeq ($(PLATFORM),AVR)
PLATFORM_COMMON_DIR = $(COMMON_DIR)/avr
else ifeq ($(PLATFORM),CHIBIOS)
PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios
+else ifeq ($(PLATFORM),ARM_ATSAM)
+ PLATFORM_COMMON_DIR = $(COMMON_DIR)/arm_atsam
else
PLATFORM_COMMON_DIR = $(COMMON_DIR)/test
endif
@@ -29,12 +31,31 @@ endif
ifeq ($(PLATFORM),CHIBIOS)
TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
- TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
+ ifeq ($(MCU_SERIES), STM32F3xx)
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
+ TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F303xC
+ TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE
+ else ifeq ($(MCU_SERIES), STM32F1xx)
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
+ TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F103xB
+ TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE
+ else
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c
+ endif
ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c
+ else ifeq ($(strip $(TERMINAL_ENABLE)), yes)
+ TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c
endif
endif
+ifeq ($(PLATFORM),ARM_ATSAM)
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
+ TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
+endif
+
ifeq ($(PLATFORM),TEST)
TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
endif
@@ -42,22 +63,50 @@ endif
# Option modules
-ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
+BOOTMAGIC_ENABLE ?= no
+VALID_MAGIC_TYPES := yes full lite
+ifneq ($(strip $(BOOTMAGIC_ENABLE)), no)
+ ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),)
+ $(error BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic)
+ endif
+ ifeq ($(strip $(BOOTMAGIC_ENABLE)), lite)
+ TMK_COMMON_DEFS += -DBOOTMAGIC_LITE
+ TMK_COMMON_DEFS += -DMAGIC_ENABLE
+ TMK_COMMON_SRC += $(COMMON_DIR)/magic.c
+ else
TMK_COMMON_DEFS += -DBOOTMAGIC_ENABLE
TMK_COMMON_SRC += $(COMMON_DIR)/bootmagic.c
+ endif
else
TMK_COMMON_DEFS += -DMAGIC_ENABLE
TMK_COMMON_SRC += $(COMMON_DIR)/magic.c
endif
+SHARED_EP_ENABLE = no
+MOUSE_SHARED_EP ?= yes
+ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes)
+ TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP
+ SHARED_EP_ENABLE = yes
+ # With the current usb_descriptor.c code,
+ # you can't share kbd without sharing mouse;
+ # that would be a very unexpected use case anyway
+ MOUSE_SHARED_EP = yes
+endif
+
ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c
TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE
TMK_COMMON_DEFS += -DMOUSE_ENABLE
+
+ ifeq ($(strip $(MOUSE_SHARED_EP)), yes)
+ TMK_COMMON_DEFS += -DMOUSE_SHARED_EP
+ SHARED_EP_ENABLE = yes
+ endif
endif
ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE
+ SHARED_EP_ENABLE = yes
endif
ifeq ($(strip $(RAW_ENABLE)), yes)
@@ -78,6 +127,7 @@ endif
ifeq ($(strip $(NKRO_ENABLE)), yes)
TMK_COMMON_DEFS += -DNKRO_ENABLE
+ SHARED_EP_ENABLE = yes
endif
ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
@@ -149,6 +199,10 @@ ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
+ TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
+endif
+
# Bootloader address
ifdef STM32_BOOTLOADER_ADDRESS
TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)