aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol.mk')
-rw-r--r--tmk_core/protocol.mk92
1 files changed, 60 insertions, 32 deletions
diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk
index b61f2f546..a8723e6b2 100644
--- a/tmk_core/protocol.mk
+++ b/tmk_core/protocol.mk
@@ -1,57 +1,85 @@
1PROTOCOL_DIR = protocol 1PROTOCOL_DIR = protocol
2 2
3ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes) 3TMK_COMMON_SRC += \
4 SRC += $(PROTOCOL_DIR)/ps2_mouse.c 4 $(PROTOCOL_DIR)/host.c \
5 OPT_DEFS += -DPS2_MOUSE_ENABLE 5 $(PROTOCOL_DIR)/report.c \
6 $(PROTOCOL_DIR)/usb_device_state.c \
7 $(PROTOCOL_DIR)/usb_util.c \
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)
6 OPT_DEFS += -DMOUSE_ENABLE 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
7endif 26endif
8 27
9ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes) 28ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
10 SRC += protocol/ps2_busywait.c 29 TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE
11 SRC += protocol/ps2_io_avr.c 30 SHARED_EP_ENABLE = yes
12 OPT_DEFS += -DPS2_USE_BUSYWAIT
13endif 31endif
14 32
15ifeq ($(strip $(PS2_USE_INT)), yes) 33ifeq ($(strip $(RAW_ENABLE)), yes)
16 SRC += protocol/ps2_interrupt.c 34 TMK_COMMON_DEFS += -DRAW_ENABLE
17 SRC += protocol/ps2_io_$(PLATFORM_KEY).c
18 OPT_DEFS += -DPS2_USE_INT
19endif 35endif
20 36
21ifeq ($(strip $(PS2_USE_USART)), yes) 37ifeq ($(strip $(CONSOLE_ENABLE)), yes)
22 SRC += protocol/ps2_usart.c 38 TMK_COMMON_DEFS += -DCONSOLE_ENABLE
23 SRC += protocol/ps2_io_$(PLATFORM_KEY).c 39else
24 OPT_DEFS += -DPS2_USE_USART 40 # TODO: decouple this so other print backends can exist
41 TMK_COMMON_DEFS += -DNO_PRINT
42 TMK_COMMON_DEFS += -DNO_DEBUG
25endif 43endif
26 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
27 55
28ifeq ($(strip $(SERIAL_MOUSE_MICROSOFT_ENABLE)), yes) 56ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes)
29 SRC += $(PROTOCOL_DIR)/serial_mouse_microsoft.c 57 TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE
30 OPT_DEFS += -DSERIAL_MOUSE_ENABLE -DSERIAL_MOUSE_MICROSOFT \
31 -DMOUSE_ENABLE
32endif 58endif
33 59
34ifeq ($(strip $(SERIAL_MOUSE_MOUSESYSTEMS_ENABLE)), yes) 60ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
35 SRC += $(PROTOCOL_DIR)/serial_mouse_mousesystems.c 61 TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
36 OPT_DEFS += -DSERIAL_MOUSE_ENABLE -DSERIAL_MOUSE_MOUSESYSTEMS \
37 -DMOUSE_ENABLE
38endif 62endif
39 63
40ifeq ($(strip $(SERIAL_MOUSE_USE_SOFT)), yes) 64ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
41 SRC += $(PROTOCOL_DIR)/serial_soft.c 65 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
42endif 66endif
43 67
44ifeq ($(strip $(SERIAL_MOUSE_USE_UART)), yes) 68ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes)
45 SRC += $(PROTOCOL_DIR)/serial_uart.c 69 TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP
70 SHARED_EP_ENABLE = yes
46endif 71endif
47 72
48ifeq ($(strip $(ADB_MOUSE_ENABLE)), yes) 73ifeq ($(strip $(DIGITIZER_ENABLE)), yes)
49 OPT_DEFS += -DADB_MOUSE_ENABLE -DMOUSE_ENABLE 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
50endif 79endif
51 80
52ifeq ($(strip $(XT_ENABLE)), yes) 81ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
53 SRC += $(PROTOCOL_DIR)/xt_interrupt.c 82 TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
54 OPT_DEFS += -DXT_ENABLE
55endif 83endif
56 84
57ifeq ($(strip $(USB_HID_ENABLE)), yes) 85ifeq ($(strip $(USB_HID_ENABLE)), yes)