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 INTERRUPT_CONTROL_ENDPOINT for converters which requires ISR in particular,
45 # it can block other ISRs long like 500-1000us for HID keyboard LED report.
46 #TMK_LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
47 TMK_LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
48 TMK_LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
49 # Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361
50 ifeq ($(MCU),atmega32u2)
51 TMK_LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
54 ifeq (yes,$(strip $(TMK_LUFA_DEBUG)))
55 TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG
58 ifeq (yes,$(strip $(TMK_LUFA_DEBUG_SUART)))
59 SRC += common/avr/suart.S
60 TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG_SUART
61 # Keep print/debug lines when disabling HID console. See common.mk.
62 DEBUG_PRINT_AVAILABLE = yes
65 ifeq (yes,$(strip $(TMK_LUFA_DEBUG_UART)))
66 SRC += common/avr/uart.c
67 TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG_UART
68 # Keep print/debug lines when disabling HID console. See common.mk.
69 DEBUG_PRINT_AVAILABLE = yes
73 OPT_DEFS += -DF_USB=$(F_USB)UL
74 OPT_DEFS += -DARCH=ARCH_$(ARCH)
75 OPT_DEFS += $(TMK_LUFA_OPTS)
77 # This indicates using LUFA stack
78 OPT_DEFS += -DPROTOCOL_LUFA