]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/lufa.mk
Extended the hint of the programmer to link to the relevant README part instead of...
[qmk_firmware.git] / tmk_core / protocol / lufa.mk
1 LUFA_DIR = protocol/lufa
2
3 # Path to the LUFA library
4 LUFA_PATH = $(LIB_PATH)/lufa
5
6
7 # Create the LUFA source path variables by including the LUFA makefile
8 ifneq (, $(wildcard $(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
9     # New build system from 20120730
10     LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
11     DMBS_LUFA_PATH = $(LUFA_PATH)/LUFA/Build/LUFA
12     include $(LUFA_PATH)/LUFA/Build/lufa_sources.mk
13 else
14     include $(LUFA_PATH)/LUFA/makefile
15 endif
16
17 LUFA_SRC = lufa.c \
18            descriptor.c \
19            outputselect.c \
20            $(LUFA_SRC_USB)
21
22 ifeq ($(strip $(MIDI_ENABLE)), yes)
23         include $(TMK_PATH)/protocol/midi.mk
24 endif
25
26 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
27         LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
28         $(TMK_DIR)/protocol/serial_uart.c
29 endif
30
31 ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
32                 LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
33 endif
34
35 ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
36         LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
37         $(TMK_DIR)/protocol/serial_uart.c
38 endif
39
40 ifeq ($(strip $(BLUETOOTH)), RN42)
41         LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
42         $(TMK_DIR)/protocol/serial_uart.c
43 endif
44
45 ifeq ($(strip $(VIRTSER_ENABLE)), yes)
46         LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
47 endif
48
49 SRC += $(LUFA_SRC)
50
51 # Search Path
52 VPATH += $(TMK_PATH)/$(LUFA_DIR)
53 VPATH += $(LUFA_PATH)
54
55 # Option modules
56 #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
57 #endif
58
59 #ifdef EXTRAKEY_ENABLE
60 #endif
61
62 # LUFA library compile-time options and predefined tokens
63 LUFA_OPTS  = -DUSB_DEVICE_ONLY
64 LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
65 LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
66 #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
67 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 
68 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
69 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
70
71 # Remote wakeup fix for ATmega32U2        https://github.com/tmk/tmk_keyboard/issues/361
72 ifeq ($(MCU),atmega32u2)
73         LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
74 endif
75
76 OPT_DEFS += -DF_USB=$(F_USB)UL
77 OPT_DEFS += -DARCH=ARCH_$(ARCH)
78 OPT_DEFS += $(LUFA_OPTS)
79
80 # This indicates using LUFA stack
81 OPT_DEFS += -DPROTOCOL_LUFA