1 TMK_LUFA_DIR = protocol/lufa
3 # Path to the LUFA library
4 TMK_LUFA_PATH ?= $(TMK_LUFA_DIR)/lufa-abcminiuser
7 # Create the LUFA source path variables by including the LUFA makefile
8 ifneq (, $(wildcard $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/Build/LUFA/lufa-sources.mk))
9 LUFA_PATH = $(TMK_LUFA_PATH)/LUFA
10 include $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/Build/LUFA/lufa-sources.mk
12 $(error LUFA may be too old or not found: try 'git submodule update --init')
13 # ifneq (, $(wildcard $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/Build/lufa_sources.mk))
14 # # build system from 20120730
15 # LUFA_PATH = $(TMK_LUFA_PATH)
16 # LUFA_ROOT_PATH = $(TMK_LUFA_PATH)/LUFA
17 # include $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/Build/lufa_sources.mk
19 # include $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/makefile
23 TMK_LUFA_SRC = $(TMK_LUFA_DIR)/lufa.c \
24 $(TMK_LUFA_DIR)/descriptor.c \
25 $(LUFA_SRC_USB_DEVICE)
27 SRC += $(TMK_LUFA_SRC)
30 VPATH += $(TMK_DIR)/$(TMK_LUFA_DIR)
31 VPATH += $(TMK_DIR)/$(TMK_LUFA_PATH)
34 #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
37 #ifdef EXTRAKEY_ENABLE
40 # LUFA library compile-time options and predefined tokens
41 TMK_LUFA_OPTS = -DUSB_DEVICE_ONLY
42 TMK_LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
43 TMK_LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
44 # Do not enable this for converters in particular, it blocks other tasks long.
45 #TMK_LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
46 TMK_LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
47 TMK_LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
48 # Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361
49 ifeq ($(MCU),atmega32u2)
50 TMK_LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
53 ifeq (yes,$(strip $(TMK_LUFA_DEBUG)))
54 TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG
57 ifeq (yes,$(strip $(TMK_LUFA_DEBUG_SUART)))
58 SRC += common/avr/suart.S
59 TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG_SUART
60 # Keep print/debug lines when disabling HID console. See common.mk.
61 DEBUG_PRINT_AVAILABLE = yes
64 ifeq (yes,$(strip $(TMK_LUFA_DEBUG_UART)))
65 SRC += common/avr/uart.c
66 TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG_UART
67 # Keep print/debug lines when disabling HID console. See common.mk.
68 DEBUG_PRINT_AVAILABLE = yes
72 OPT_DEFS += -DF_USB=$(F_USB)UL
73 OPT_DEFS += -DARCH=ARCH_$(ARCH)
74 OPT_DEFS += $(TMK_LUFA_OPTS)
76 # This indicates using LUFA stack
77 OPT_DEFS += -DPROTOCOL_LUFA