]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/protocol/lufa.mk
1b529bde61e15dc6575150545b1de1f8cefdc0e3
[max/tmk_keyboard.git] / tmk_core / protocol / lufa.mk
1 LUFA_DIR = protocol/lufa
2
3 # Path to the LUFA library
4 LUFA_PATH ?= $(LUFA_DIR)/LUFA-git
5
6
7 # Create the LUFA source path variables by including the LUFA makefile
8 ifneq (, $(wildcard $(TMK_DIR)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
9     # New build system from 20120730
10     LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
11     include $(TMK_DIR)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk 
12 else
13     include $(TMK_DIR)/$(LUFA_PATH)/LUFA/makefile
14 endif
15
16 LUFA_SRC = $(LUFA_DIR)/lufa.c \
17            $(LUFA_DIR)/descriptor.c \
18            $(LUFA_SRC_USB)
19
20 SRC += $(LUFA_SRC)
21
22 # Search Path
23 VPATH += $(TMK_DIR)/$(LUFA_DIR)
24 VPATH += $(TMK_DIR)/$(LUFA_PATH)
25
26 # Option modules
27 #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
28 #endif
29
30 #ifdef EXTRAKEY_ENABLE
31 #endif
32
33 # LUFA library compile-time options and predefined tokens
34 LUFA_OPTS  = -DUSB_DEVICE_ONLY
35 LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
36 LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
37 #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
38 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 
39 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
40 # Remote wakeup fix for ATmega32U2        https://github.com/tmk/tmk_keyboard/issues/361
41 ifeq ($(MCU),atmega32u2)
42         LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
43 endif
44
45 OPT_DEFS += -DF_USB=$(F_USB)UL
46 OPT_DEFS += -DARCH=ARCH_$(ARCH)
47 OPT_DEFS += $(LUFA_OPTS)
48
49 # This indicates using LUFA stack
50 OPT_DEFS += -DPROTOCOL_LUFA
51
52 ifeq (yes,$(strip $(LUFA_DEBUG_SUART)))
53     SRC += common/avr/suart.S
54     LUFA_OPTS += -DLUFA_DEBUG_SUART
55 endif