2012-06-28 23:05:21 +09:00
|
|
|
LUFA_DIR = protocol/lufa
|
|
|
|
|
|
|
|
|
|
# Path to the LUFA library
|
2017-07-07 12:06:59 -04:00
|
|
|
LUFA_PATH = $(LIB_PATH)/lufa
|
2014-04-25 12:52:47 +09:00
|
|
|
|
2013-02-11 22:56:30 +09:00
|
|
|
# Create the LUFA source path variables by including the LUFA makefile
|
2017-07-07 12:06:59 -04:00
|
|
|
ifneq (, $(wildcard $(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
|
2013-02-11 22:56:30 +09:00
|
|
|
# New build system from 20120730
|
|
|
|
|
LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
|
2017-07-07 12:06:59 -04:00
|
|
|
DMBS_LUFA_PATH = $(LUFA_PATH)/LUFA/Build/LUFA
|
|
|
|
|
include $(LUFA_PATH)/LUFA/Build/lufa_sources.mk
|
2013-02-11 22:56:30 +09:00
|
|
|
else
|
2017-07-07 12:06:59 -04:00
|
|
|
include $(LUFA_PATH)/LUFA/makefile
|
2013-02-11 22:56:30 +09:00
|
|
|
endif
|
2012-06-28 23:05:21 +09:00
|
|
|
|
2016-06-11 13:31:31 -04:00
|
|
|
LUFA_SRC = lufa.c \
|
2020-06-17 21:43:20 +10:00
|
|
|
usb_descriptor.c \
|
|
|
|
|
$(LUFA_SRC_USB)
|
2015-08-24 19:31:12 -04:00
|
|
|
|
2016-04-15 00:26:22 -04:00
|
|
|
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
2016-06-18 14:30:24 -04:00
|
|
|
include $(TMK_PATH)/protocol/midi.mk
|
2015-08-24 19:31:12 -04:00
|
|
|
endif
|
2012-08-25 15:49:08 +09:00
|
|
|
|
2016-08-01 05:02:52 +00:00
|
|
|
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
|
|
|
|
LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
|
|
|
|
|
endif
|
|
|
|
|
|
2012-08-25 15:49:08 +09:00
|
|
|
SRC += $(LUFA_SRC)
|
2021-02-28 15:52:58 +00:00
|
|
|
SRC += $(LUFA_DIR)/usb_util.c
|
2012-06-28 23:05:21 +09:00
|
|
|
|
|
|
|
|
# Search Path
|
2016-06-11 13:31:31 -04:00
|
|
|
VPATH += $(TMK_PATH)/$(LUFA_DIR)
|
2017-07-07 12:06:59 -04:00
|
|
|
VPATH += $(LUFA_PATH)
|
2012-06-28 23:05:21 +09:00
|
|
|
|
|
|
|
|
# LUFA library compile-time options and predefined tokens
|
2014-04-24 11:26:06 +09:00
|
|
|
LUFA_OPTS = -DUSB_DEVICE_ONLY
|
|
|
|
|
LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
|
|
|
|
|
LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
|
2017-03-24 12:53:55 -04:00
|
|
|
LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
|
2014-04-24 11:26:06 +09:00
|
|
|
LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
|
2012-06-28 23:05:21 +09:00
|
|
|
|
2021-04-19 19:33:24 +03:00
|
|
|
# Remote wakeup fix for ATmega16/32U2 https://github.com/tmk/tmk_keyboard/issues/361
|
|
|
|
|
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2))
|
2016-06-21 22:39:54 -04:00
|
|
|
LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
|
|
|
|
|
endif
|
|
|
|
|
|
2012-06-28 23:05:21 +09:00
|
|
|
OPT_DEFS += -DF_USB=$(F_USB)UL
|
|
|
|
|
OPT_DEFS += -DARCH=ARCH_$(ARCH)
|
|
|
|
|
OPT_DEFS += $(LUFA_OPTS)
|
2013-03-09 11:22:27 +09:00
|
|
|
|
|
|
|
|
# This indicates using LUFA stack
|
|
|
|
|
OPT_DEFS += -DPROTOCOL_LUFA
|