lufa.mk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 $(BLUETOOTH_ENABLE)), yes)
  20. LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
  21. $(TMK_DIR)/protocol/serial_uart.c
  22. endif
  23. ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
  24. LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp
  25. endif
  26. ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
  27. LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
  28. $(TMK_DIR)/protocol/serial_uart.c
  29. endif
  30. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  31. LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
  32. endif
  33. SRC += $(LUFA_SRC)
  34. # Search Path
  35. VPATH += $(TMK_PATH)/$(LUFA_DIR)
  36. VPATH += $(TMK_PATH)/$(LUFA_PATH)
  37. # Option modules
  38. #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
  39. #endif
  40. #ifdef EXTRAKEY_ENABLE
  41. #endif
  42. # LUFA library compile-time options and predefined tokens
  43. LUFA_OPTS = -DUSB_DEVICE_ONLY
  44. LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
  45. LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
  46. #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
  47. LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
  48. LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
  49. LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
  50. # Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361
  51. ifeq ($(MCU),atmega32u2)
  52. LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
  53. endif
  54. OPT_DEFS += -DF_USB=$(F_USB)UL
  55. OPT_DEFS += -DARCH=ARCH_$(ARCH)
  56. OPT_DEFS += $(LUFA_OPTS)
  57. # This indicates using LUFA stack
  58. OPT_DEFS += -DPROTOCOL_LUFA