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