]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/protocol/lufa.mk
usb_hid: Update arduino cores to 1.8.13
[max/tmk_keyboard.git] / tmk_core / protocol / lufa.mk
1 TMK_LUFA_DIR = protocol/lufa
2
3 # Path to the LUFA library
4 TMK_LUFA_PATH ?= $(TMK_LUFA_DIR)/lufa-abcminiuser
5
6
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
11 else
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
18 #    else
19 #        include $(TMK_DIR)/$(TMK_LUFA_PATH)/LUFA/makefile
20 #    endif
21 endif
22
23 TMK_LUFA_SRC = $(TMK_LUFA_DIR)/lufa.c \
24                $(TMK_LUFA_DIR)/descriptor.c \
25                $(LUFA_SRC_USB_DEVICE)
26
27 SRC += $(TMK_LUFA_SRC)
28
29 # Search Path
30 VPATH += $(TMK_DIR)/$(TMK_LUFA_DIR)
31 VPATH += $(TMK_DIR)/$(TMK_LUFA_PATH)
32
33 # Option modules
34 #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
35 #endif
36
37 #ifdef EXTRAKEY_ENABLE
38 #endif
39
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
52 endif
53
54 ifeq (yes,$(strip $(TMK_LUFA_DEBUG)))
55     TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG
56 endif
57
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
63 endif
64
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
70 endif
71
72
73 OPT_DEFS += -DF_USB=$(F_USB)UL
74 OPT_DEFS += -DARCH=ARCH_$(ARCH)
75 OPT_DEFS += $(TMK_LUFA_OPTS)
76
77 # This indicates using LUFA stack
78 OPT_DEFS += -DPROTOCOL_LUFA