qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

lufa.mk (1533B)


      1 LUFA_DIR = protocol/lufa
      2 
      3 # Path to the LUFA library
      4 LUFA_PATH = $(LIB_PATH)/lufa
      5 
      6 # Create the LUFA source path variables by including the LUFA makefile
      7 ifneq (, $(wildcard $(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
      8     # New build system from 20120730
      9     LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
     10     DMBS_LUFA_PATH = $(LUFA_PATH)/LUFA/Build/LUFA
     11     include $(LUFA_PATH)/LUFA/Build/lufa_sources.mk
     12 else
     13     include $(LUFA_PATH)/LUFA/makefile
     14 endif
     15 
     16 LUFA_SRC = lufa.c \
     17 	usb_descriptor.c \
     18 	$(LUFA_SRC_USB)
     19 
     20 ifeq ($(strip $(MIDI_ENABLE)), yes)
     21 	LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c
     22 endif
     23 
     24 ifeq ($(strip $(VIRTSER_ENABLE)), yes)
     25 	LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
     26 endif
     27 
     28 SRC += $(LUFA_SRC)
     29 SRC += $(LUFA_DIR)/usb_util.c
     30 
     31 # Search Path
     32 VPATH += $(TMK_PATH)/$(LUFA_DIR)
     33 VPATH += $(LUFA_PATH)
     34 
     35 # LUFA library compile-time options and predefined tokens
     36 LUFA_OPTS  = -DUSB_DEVICE_ONLY
     37 LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
     38 LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
     39 LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
     40 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
     41 
     42 # Remote wakeup fix for ATmega16/32U2        https://github.com/tmk/tmk_keyboard/issues/361
     43 ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2))
     44 	LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
     45 endif
     46 
     47 OPT_DEFS += -DF_USB=$(F_USB)UL
     48 OPT_DEFS += -DARCH=ARCH_$(ARCH)
     49 OPT_DEFS += $(LUFA_OPTS)
     50 
     51 # This indicates using LUFA stack
     52 OPT_DEFS += -DPROTOCOL_LUFA