]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/lufa.mk
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
[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            $(LUFA_SRC_USB)
19
20 ifeq ($(strip $(MIDI_ENABLE)), yes)
21         include $(TMK_PATH)/protocol/midi.mk
22 endif
23
24 ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes)
25         LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
26 endif
27
28 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
29         LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
30         $(TMK_DIR)/protocol/serial_uart.c
31 endif
32
33 ifeq ($(strip $(VIRTSER_ENABLE)), yes)
34         LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
35 endif
36
37 SRC += $(LUFA_SRC)
38
39 # Search Path
40 VPATH += $(TMK_PATH)/$(LUFA_DIR)
41 VPATH += $(TMK_PATH)/$(LUFA_PATH)
42
43 # Option modules
44 #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
45 #endif
46
47 #ifdef EXTRAKEY_ENABLE
48 #endif
49
50 # LUFA library compile-time options and predefined tokens
51 LUFA_OPTS  = -DUSB_DEVICE_ONLY
52 LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
53 LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
54 #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
55 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 
56 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
57
58 # Remote wakeup fix for ATmega32U2        https://github.com/tmk/tmk_keyboard/issues/361
59 ifeq ($(MCU),atmega32u2)
60         LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
61 endif
62
63 OPT_DEFS += -DF_USB=$(F_USB)UL
64 OPT_DEFS += -DARCH=ARCH_$(ARCH)
65 OPT_DEFS += $(LUFA_OPTS)
66
67 # This indicates using LUFA stack
68 OPT_DEFS += -DPROTOCOL_LUFA