lufa.mk 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. LUFA_DIR = protocol/lufa
  2. # Path to the LUFA library
  3. LUFA_PATH = $(LIB_PATH)/lufa
  4. # Create the LUFA source path variables by including the LUFA makefile
  5. ifneq (, $(wildcard $(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
  6. # New build system from 20120730
  7. LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
  8. DMBS_LUFA_PATH = $(LUFA_PATH)/LUFA/Build/LUFA
  9. include $(LUFA_PATH)/LUFA/Build/lufa_sources.mk
  10. else
  11. include $(LUFA_PATH)/LUFA/makefile
  12. endif
  13. LUFA_SRC = lufa.c \
  14. usb_descriptor.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 += outputselect.c \
  21. $(TMK_DIR)/protocol/serial_uart.c
  22. endif
  23. ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
  24. LUFA_SRC += spi_master.c \
  25. analog.c \
  26. outputselect.c \
  27. $(LUFA_DIR)/adafruit_ble.cpp
  28. endif
  29. ifeq ($(strip $(BLUETOOTH)), RN42)
  30. LUFA_SRC += outputselect.c \
  31. $(TMK_DIR)/protocol/serial_uart.c
  32. endif
  33. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  34. LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
  35. endif
  36. SRC += $(LUFA_SRC)
  37. # Search Path
  38. VPATH += $(TMK_PATH)/$(LUFA_DIR)
  39. VPATH += $(LUFA_PATH)
  40. VPATH += $(DRIVER_PATH)/avr
  41. # Option modules
  42. #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
  43. #endif
  44. #ifdef EXTRAKEY_ENABLE
  45. #endif
  46. # LUFA library compile-time options and predefined tokens
  47. LUFA_OPTS = -DUSB_DEVICE_ONLY
  48. LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
  49. LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
  50. #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
  51. LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
  52. LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
  53. LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
  54. # Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361
  55. ifeq ($(MCU),atmega32u2)
  56. LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
  57. endif
  58. OPT_DEFS += -DF_USB=$(F_USB)UL
  59. OPT_DEFS += -DARCH=ARCH_$(ARCH)
  60. OPT_DEFS += $(LUFA_OPTS)
  61. # This indicates using LUFA stack
  62. OPT_DEFS += -DPROTOCOL_LUFA