Parent directory

protocol.mk

2585 bytes
  1SRC +=	\
  2	$(PROTOCOL_DIR)/host.c \
  3	$(PROTOCOL_DIR)/report.c \
  4	$(PROTOCOL_DIR)/usb_device_state.c \
  5	$(PROTOCOL_DIR)/usb_util.c \
  6
  7SHARED_EP_ENABLE = no
  8MOUSE_SHARED_EP ?= yes
  9ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes)
 10    OPT_DEFS += -DKEYBOARD_SHARED_EP
 11    SHARED_EP_ENABLE = yes
 12    # With the current usb_descriptor.c code,
 13    # you can't share kbd without sharing mouse;
 14    # that would be a very unexpected use case anyway
 15    MOUSE_SHARED_EP = yes
 16endif
 17
 18ifeq ($(strip $(MOUSE_ENABLE)), yes)
 19    OPT_DEFS += -DMOUSE_ENABLE
 20    ifeq ($(strip $(MOUSE_SHARED_EP)), yes)
 21        OPT_DEFS += -DMOUSE_SHARED_EP
 22        SHARED_EP_ENABLE = yes
 23    endif
 24endif
 25
 26ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
 27    OPT_DEFS += -DEXTRAKEY_ENABLE
 28    SHARED_EP_ENABLE = yes
 29endif
 30
 31ifeq ($(strip $(PROGRAMMABLE_BUTTON_ENABLE)), yes)
 32    OPT_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE
 33    SHARED_EP_ENABLE = yes
 34endif
 35
 36ifeq ($(strip $(RAW_ENABLE)), yes)
 37    OPT_DEFS += -DRAW_ENABLE
 38endif
 39
 40ifeq ($(strip $(CONSOLE_ENABLE)), yes)
 41    OPT_DEFS += -DCONSOLE_ENABLE
 42else
 43    # TODO: decouple this so other print backends can exist
 44    OPT_DEFS += -DNO_PRINT
 45    OPT_DEFS += -DNO_DEBUG
 46endif
 47
 48ifeq ($(strip $(NKRO_ENABLE)), yes)
 49    ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
 50        $(info NKRO is not currently supported with Bluetooth, and has been disabled.)
 51    else
 52        OPT_DEFS += -DNKRO_ENABLE
 53        SHARED_EP_ENABLE = yes
 54    endif
 55endif
 56
 57ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
 58    OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
 59endif
 60
 61ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
 62    OPT_DEFS += -DNO_USB_STARTUP_CHECK
 63endif
 64
 65ifeq ($(strip $(USB_WAIT_FOR_ENUMERATION)), yes)
 66    OPT_DEFS += -DUSB_WAIT_FOR_ENUMERATION
 67endif
 68
 69ifeq ($(strip $(JOYSTICK_SHARED_EP)), yes)
 70    OPT_DEFS += -DJOYSTICK_SHARED_EP
 71    SHARED_EP_ENABLE = yes
 72endif
 73
 74ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
 75    OPT_DEFS += -DJOYSTICK_ENABLE
 76    ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
 77        OPT_DEFS += -DJOYSTICK_SHARED_EP
 78        SHARED_EP_ENABLE = yes
 79    endif
 80endif
 81
 82ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes)
 83    OPT_DEFS += -DDIGITIZER_SHARED_EP
 84    SHARED_EP_ENABLE = yes
 85endif
 86
 87ifeq ($(strip $(DIGITIZER_ENABLE)), yes)
 88    OPT_DEFS += -DDIGITIZER_ENABLE
 89    ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
 90        OPT_DEFS += -DDIGITIZER_SHARED_EP
 91        SHARED_EP_ENABLE = yes
 92    endif
 93endif
 94
 95ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
 96    OPT_DEFS += -DSHARED_EP_ENABLE
 97endif
 98
 99ifeq ($(strip $(USB_HID_ENABLE)), yes)
100    include $(TMK_DIR)/protocol/usb_hid/usb_hid.mk
101endif
102
103# Search Path
104VPATH += $(TMK_DIR)/protocol