aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-10-29 11:16:19 +0100
committerGitHub <noreply@github.com>2021-10-29 11:16:19 +0100
commit55fb468d7453eb31bc1793772938e2d28881fcaa (patch)
tree071269b83b618ca256ac5421b3bcddfde158b349 /tmk_core
parent0f9261424097863d23b6f4835dd3f374c6776ec7 (diff)
downloadqmk_firmware-55fb468d7453eb31bc1793772938e2d28881fcaa.tar.gz
qmk_firmware-55fb468d7453eb31bc1793772938e2d28881fcaa.zip
More platform/protocol alignment (#14976)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common.mk86
-rw-r--r--tmk_core/protocol.mk76
2 files changed, 76 insertions, 86 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 8fa1a31e8..555b942c9 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -10,92 +10,6 @@ TMK_COMMON_SRC += \
10# Use platform provided print if it exists 10# Use platform provided print if it exists
11-include $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk 11-include $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk
12 12
13SHARED_EP_ENABLE = no
14MOUSE_SHARED_EP ?= yes
15ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes)
16 TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP
17 SHARED_EP_ENABLE = yes
18 # With the current usb_descriptor.c code,
19 # you can't share kbd without sharing mouse;
20 # that would be a very unexpected use case anyway
21 MOUSE_SHARED_EP = yes
22endif
23
24ifeq ($(strip $(MOUSE_ENABLE)), yes)
25 OPT_DEFS += -DMOUSE_ENABLE
26 ifeq ($(strip $(MOUSE_SHARED_EP)), yes)
27 TMK_COMMON_DEFS += -DMOUSE_SHARED_EP
28 SHARED_EP_ENABLE = yes
29 endif
30endif
31
32ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
33 TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE
34 SHARED_EP_ENABLE = yes
35endif
36
37ifeq ($(strip $(RAW_ENABLE)), yes)
38 TMK_COMMON_DEFS += -DRAW_ENABLE
39endif
40
41ifeq ($(strip $(CONSOLE_ENABLE)), yes)
42 TMK_COMMON_DEFS += -DCONSOLE_ENABLE
43else
44 # TODO: decouple this so other print backends can exist
45 TMK_COMMON_DEFS += -DNO_PRINT
46 TMK_COMMON_DEFS += -DNO_DEBUG
47endif
48
49ifeq ($(strip $(NKRO_ENABLE)), yes)
50 ifeq ($(PROTOCOL), VUSB)
51 $(info NKRO is not currently supported on V-USB, and has been disabled.)
52 else ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
53 $(info NKRO is not currently supported with Bluetooth, and has been disabled.)
54 else
55 TMK_COMMON_DEFS += -DNKRO_ENABLE
56 SHARED_EP_ENABLE = yes
57 endif
58endif
59
60ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes)
61 TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE
62endif
63
64ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
65 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c
66 TMK_COMMON_DEFS += -DSLEEP_LED_ENABLE
67 TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
68endif
69
70ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
71 TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
72endif
73
74ifeq ($(strip $(SWAP_HANDS_ENABLE)), yes)
75 TMK_COMMON_DEFS += -DSWAP_HANDS_ENABLE
76endif
77
78ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
79 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
80endif
81
82ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes)
83 TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP
84 SHARED_EP_ENABLE = yes
85endif
86
87ifeq ($(strip $(DIGITIZER_ENABLE)), yes)
88 TMK_COMMON_DEFS += -DDIGITIZER_ENABLE
89 ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
90 TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP
91 SHARED_EP_ENABLE = yes
92 endif
93endif
94
95ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
96 TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
97endif
98
99# Search Path 13# Search Path
100VPATH += $(TMK_PATH)/$(COMMON_DIR) 14VPATH += $(TMK_PATH)/$(COMMON_DIR)
101VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) 15VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR)
diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk
index 359ddbfef..a8723e6b2 100644
--- a/tmk_core/protocol.mk
+++ b/tmk_core/protocol.mk
@@ -6,6 +6,82 @@ TMK_COMMON_SRC += \
6 $(PROTOCOL_DIR)/usb_device_state.c \ 6 $(PROTOCOL_DIR)/usb_device_state.c \
7 $(PROTOCOL_DIR)/usb_util.c \ 7 $(PROTOCOL_DIR)/usb_util.c \
8 8
9SHARED_EP_ENABLE = no
10MOUSE_SHARED_EP ?= yes
11ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes)
12 TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP
13 SHARED_EP_ENABLE = yes
14 # With the current usb_descriptor.c code,
15 # you can't share kbd without sharing mouse;
16 # that would be a very unexpected use case anyway
17 MOUSE_SHARED_EP = yes
18endif
19
20ifeq ($(strip $(MOUSE_ENABLE)), yes)
21 OPT_DEFS += -DMOUSE_ENABLE
22 ifeq ($(strip $(MOUSE_SHARED_EP)), yes)
23 TMK_COMMON_DEFS += -DMOUSE_SHARED_EP
24 SHARED_EP_ENABLE = yes
25 endif
26endif
27
28ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
29 TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE
30 SHARED_EP_ENABLE = yes
31endif
32
33ifeq ($(strip $(RAW_ENABLE)), yes)
34 TMK_COMMON_DEFS += -DRAW_ENABLE
35endif
36
37ifeq ($(strip $(CONSOLE_ENABLE)), yes)
38 TMK_COMMON_DEFS += -DCONSOLE_ENABLE
39else
40 # TODO: decouple this so other print backends can exist
41 TMK_COMMON_DEFS += -DNO_PRINT
42 TMK_COMMON_DEFS += -DNO_DEBUG
43endif
44
45ifeq ($(strip $(NKRO_ENABLE)), yes)
46 ifeq ($(PROTOCOL), VUSB)
47 $(info NKRO is not currently supported on V-USB, and has been disabled.)
48 else ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
49 $(info NKRO is not currently supported with Bluetooth, and has been disabled.)
50 else
51 TMK_COMMON_DEFS += -DNKRO_ENABLE
52 SHARED_EP_ENABLE = yes
53 endif
54endif
55
56ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes)
57 TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE
58endif
59
60ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
61 TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
62endif
63
64ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
65 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
66endif
67
68ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes)
69 TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP
70 SHARED_EP_ENABLE = yes
71endif
72
73ifeq ($(strip $(DIGITIZER_ENABLE)), yes)
74 TMK_COMMON_DEFS += -DDIGITIZER_ENABLE
75 ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
76 TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP
77 SHARED_EP_ENABLE = yes
78 endif
79endif
80
81ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
82 TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
83endif
84
9ifeq ($(strip $(USB_HID_ENABLE)), yes) 85ifeq ($(strip $(USB_HID_ENABLE)), yes)
10 include $(TMK_DIR)/protocol/usb_hid.mk 86 include $(TMK_DIR)/protocol/usb_hid.mk
11endif 87endif