diff options
Diffstat (limited to 'tmk_core/protocol.mk')
| -rw-r--r-- | tmk_core/protocol.mk | 92 |
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 @@ | |||
| 1 | PROTOCOL_DIR = protocol | 1 | PROTOCOL_DIR = protocol |
| 2 | 2 | ||
| 3 | ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes) | 3 | TMK_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 | |||
| 9 | SHARED_EP_ENABLE = no | ||
| 10 | MOUSE_SHARED_EP ?= yes | ||
| 11 | ifeq ($(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 | ||
| 18 | endif | ||
| 19 | |||
| 20 | ifeq ($(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 | ||
| 7 | endif | 26 | endif |
| 8 | 27 | ||
| 9 | ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes) | 28 | ifeq ($(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 | ||
| 13 | endif | 31 | endif |
| 14 | 32 | ||
| 15 | ifeq ($(strip $(PS2_USE_INT)), yes) | 33 | ifeq ($(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 | ||
| 19 | endif | 35 | endif |
| 20 | 36 | ||
| 21 | ifeq ($(strip $(PS2_USE_USART)), yes) | 37 | ifeq ($(strip $(CONSOLE_ENABLE)), yes) |
| 22 | SRC += protocol/ps2_usart.c | 38 | TMK_COMMON_DEFS += -DCONSOLE_ENABLE |
| 23 | SRC += protocol/ps2_io_$(PLATFORM_KEY).c | 39 | else |
| 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 | ||
| 25 | endif | 43 | endif |
| 26 | 44 | ||
| 45 | ifeq ($(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 | ||
| 54 | endif | ||
| 27 | 55 | ||
| 28 | ifeq ($(strip $(SERIAL_MOUSE_MICROSOFT_ENABLE)), yes) | 56 | ifeq ($(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 | ||
| 32 | endif | 58 | endif |
| 33 | 59 | ||
| 34 | ifeq ($(strip $(SERIAL_MOUSE_MOUSESYSTEMS_ENABLE)), yes) | 60 | ifeq ($(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 | ||
| 38 | endif | 62 | endif |
| 39 | 63 | ||
| 40 | ifeq ($(strip $(SERIAL_MOUSE_USE_SOFT)), yes) | 64 | ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes) |
| 41 | SRC += $(PROTOCOL_DIR)/serial_soft.c | 65 | TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK |
| 42 | endif | 66 | endif |
| 43 | 67 | ||
| 44 | ifeq ($(strip $(SERIAL_MOUSE_USE_UART)), yes) | 68 | ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes) |
| 45 | SRC += $(PROTOCOL_DIR)/serial_uart.c | 69 | TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP |
| 70 | SHARED_EP_ENABLE = yes | ||
| 46 | endif | 71 | endif |
| 47 | 72 | ||
| 48 | ifeq ($(strip $(ADB_MOUSE_ENABLE)), yes) | 73 | ifeq ($(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 | ||
| 50 | endif | 79 | endif |
| 51 | 80 | ||
| 52 | ifeq ($(strip $(XT_ENABLE)), yes) | 81 | ifeq ($(strip $(SHARED_EP_ENABLE)), yes) |
| 53 | SRC += $(PROTOCOL_DIR)/xt_interrupt.c | 82 | TMK_COMMON_DEFS += -DSHARED_EP_ENABLE |
| 54 | OPT_DEFS += -DXT_ENABLE | ||
| 55 | endif | 83 | endif |
| 56 | 84 | ||
| 57 | ifeq ($(strip $(USB_HID_ENABLE)), yes) | 85 | ifeq ($(strip $(USB_HID_ENABLE)), yes) |
