lufa.mk 1.8 KB

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