Move protocol makefiles into their respective folders (#21332)
* Move protocol makefiles into their respective folders * Fix USB-USB converter
This commit is contained in:
parent
fb76c941ee
commit
aad5746682
7 changed files with 4 additions and 3 deletions
|
|
@ -440,10 +440,11 @@ include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
|
|||
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
|
||||
|
||||
ifneq ($(strip $(PROTOCOL)),)
|
||||
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
|
||||
PROTOCOL_KEY = $(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]'))
|
||||
else
|
||||
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
|
||||
PROTOCOL_KEY = $(PLATFORM_KEY)
|
||||
endif
|
||||
include $(TMK_PATH)/protocol/$(PROTOCOL_KEY)/$(PROTOCOL_KEY).mk
|
||||
|
||||
# Setup definitions based on the selected MCU
|
||||
$(eval $(call add_qmk_prefix_defs,MCU_ORIG,MCU))
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
|
|||
endif
|
||||
|
||||
ifeq ($(strip $(USB_HID_ENABLE)), yes)
|
||||
include $(TMK_DIR)/protocol/usb_hid.mk
|
||||
include $(TMK_DIR)/protocol/usb_hid/usb_hid.mk
|
||||
endif
|
||||
|
||||
# Search Path
|
||||
|
|
|
|||
31
tmk_core/protocol/arm_atsam/arm_atsam.mk
Normal file
31
tmk_core/protocol/arm_atsam/arm_atsam.mk
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
ARM_ATSAM_DIR = protocol/arm_atsam
|
||||
|
||||
SRC += $(ARM_ATSAM_DIR)/adc.c
|
||||
SRC += $(ARM_ATSAM_DIR)/clks.c
|
||||
SRC += $(ARM_ATSAM_DIR)/d51_util.c
|
||||
SRC += $(ARM_ATSAM_DIR)/i2c_master.c
|
||||
ifeq ($(RGB_MATRIX_DRIVER),custom)
|
||||
SRC += $(ARM_ATSAM_DIR)/md_rgb_matrix_programs.c
|
||||
SRC += $(ARM_ATSAM_DIR)/md_rgb_matrix.c
|
||||
endif
|
||||
SRC += $(ARM_ATSAM_DIR)/main_arm_atsam.c
|
||||
SRC += $(ARM_ATSAM_DIR)/shift_register.c
|
||||
SRC += $(ARM_ATSAM_DIR)/spi_master.c
|
||||
SRC += $(ARM_ATSAM_DIR)/startup.c
|
||||
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/main_usb.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/udc.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/udi_cdc.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/udi_hid.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/udi_hid_kbd.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/udi_hid_kbd_desc.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/ui.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/usb.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/usb_device_udd.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/usb_hub.c
|
||||
SRC += $(ARM_ATSAM_DIR)/usb/usb_util.c
|
||||
|
||||
SRC += $(DRIVER_PATH)/usb2422.c
|
||||
|
||||
# Search Path
|
||||
VPATH += $(TMK_DIR)/$(ARM_ATSAM_DIR)
|
||||
17
tmk_core/protocol/chibios/chibios.mk
Normal file
17
tmk_core/protocol/chibios/chibios.mk
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
PROTOCOL_DIR = protocol
|
||||
CHIBIOS_DIR = $(PROTOCOL_DIR)/chibios
|
||||
|
||||
|
||||
SRC += $(CHIBIOS_DIR)/usb_main.c
|
||||
SRC += $(CHIBIOS_DIR)/chibios.c
|
||||
SRC += usb_descriptor.c
|
||||
SRC += $(CHIBIOS_DIR)/usb_driver.c
|
||||
SRC += $(CHIBIOS_DIR)/usb_util.c
|
||||
SRC += $(LIBSRC)
|
||||
|
||||
VPATH += $(TMK_PATH)/$(PROTOCOL_DIR)
|
||||
VPATH += $(TMK_PATH)/$(CHIBIOS_DIR)
|
||||
VPATH += $(TMK_PATH)/$(CHIBIOS_DIR)/lufa_utils
|
||||
|
||||
OPT_DEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=64
|
||||
OPT_DEFS += -DFIXED_NUM_CONFIGURATIONS=1
|
||||
52
tmk_core/protocol/lufa/lufa.mk
Normal file
52
tmk_core/protocol/lufa/lufa.mk
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
LUFA_DIR = protocol/lufa
|
||||
|
||||
# Path to the LUFA library
|
||||
LUFA_PATH = $(LIB_PATH)/lufa
|
||||
|
||||
# Create the LUFA source path variables by including the LUFA makefile
|
||||
ifneq (, $(wildcard $(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
|
||||
# New build system from 20120730
|
||||
LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
|
||||
DMBS_LUFA_PATH = $(LUFA_PATH)/LUFA/Build/LUFA
|
||||
include $(LUFA_PATH)/LUFA/Build/lufa_sources.mk
|
||||
else
|
||||
include $(LUFA_PATH)/LUFA/makefile
|
||||
endif
|
||||
|
||||
LUFA_SRC = lufa.c \
|
||||
usb_descriptor.c \
|
||||
$(LUFA_SRC_USB)
|
||||
|
||||
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
||||
LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
||||
LUFA_SRC += $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c
|
||||
endif
|
||||
|
||||
SRC += $(LUFA_SRC)
|
||||
SRC += $(LUFA_DIR)/usb_util.c
|
||||
|
||||
# Search Path
|
||||
VPATH += $(TMK_PATH)/$(LUFA_DIR)
|
||||
VPATH += $(LUFA_PATH)
|
||||
|
||||
# LUFA library compile-time options and predefined tokens
|
||||
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)"
|
||||
LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
|
||||
LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
|
||||
|
||||
# Remote wakeup fix for ATmega16/32U2 https://github.com/tmk/tmk_keyboard/issues/361
|
||||
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2))
|
||||
LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
|
||||
endif
|
||||
|
||||
OPT_DEFS += -DF_USB=$(F_USB)UL
|
||||
OPT_DEFS += -DARCH=ARCH_$(ARCH)
|
||||
OPT_DEFS += $(LUFA_OPTS)
|
||||
|
||||
# This indicates using LUFA stack
|
||||
OPT_DEFS += -DPROTOCOL_LUFA
|
||||
73
tmk_core/protocol/usb_hid/usb_hid.mk
Normal file
73
tmk_core/protocol/usb_hid/usb_hid.mk
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
USB_HID_DIR = protocol/usb_hid
|
||||
USB_HOST_LIB_DIR = $(LIB_PATH)/usbhost
|
||||
|
||||
#
|
||||
# USB Host Shield
|
||||
#
|
||||
USB_HOST_SHIELD_DIR = $(USB_HOST_LIB_DIR)/USB_Host_Shield_2.0
|
||||
USB_HOST_SHIELD_SRC = \
|
||||
$(USB_HOST_SHIELD_DIR)/Usb.cpp \
|
||||
$(USB_HOST_SHIELD_DIR)/hid.cpp \
|
||||
$(USB_HOST_SHIELD_DIR)/usbhub.cpp \
|
||||
$(USB_HOST_SHIELD_DIR)/parsetools.cpp \
|
||||
$(USB_HOST_SHIELD_DIR)/message.cpp
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Arduino
|
||||
#
|
||||
ARDUINO_DIR = $(USB_HOST_LIB_DIR)/arduino-1.0.1
|
||||
ARDUINO_CORES_DIR = $(ARDUINO_DIR)/cores/arduino
|
||||
ARDUINO_CORES_SRC = \
|
||||
$(ARDUINO_CORES_DIR)/Print.cpp \
|
||||
$(ARDUINO_CORES_DIR)/Stream.cpp
|
||||
|
||||
# replaced with override_Serial.c
|
||||
# $(ARDUINO_CORES_DIR)/CDC.cpp \
|
||||
# $(ARDUINO_CORES_DIR)/HID.cpp \
|
||||
# $(ARDUINO_CORES_DIR)/USBCore.cpp \
|
||||
|
||||
# replaced with override_wiring.c and common/timer.c
|
||||
# $(ARDUINO_CORES_DIR)/wiring.c \
|
||||
|
||||
|
||||
|
||||
#
|
||||
# HID parser
|
||||
#
|
||||
SRC += $(USB_HID_DIR)/parser.cpp
|
||||
|
||||
# replace arduino/CDC.cpp
|
||||
SRC += $(USB_HID_DIR)/override_Serial.cpp
|
||||
|
||||
# replace arduino/wiring.c
|
||||
SRC += $(USB_HID_DIR)/override_wiring.c
|
||||
|
||||
SRC += $(USB_HOST_SHIELD_SRC)
|
||||
SRC += $(ARDUINO_CORES_SRC)
|
||||
|
||||
|
||||
OPT_DEFS += -DARDUINO=101
|
||||
# Arduino USBCore needs USB_VID and USB_PID.
|
||||
#OPT_DEFS += -DARDUINO=101 -DUSB_VID=0x2341 -DUSB_PID=0x8036
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Search Path
|
||||
#
|
||||
VPATH += $(TMK_DIR)/$(USB_HID_DIR)
|
||||
VPATH += $(USB_HOST_SHIELD_DIR)
|
||||
|
||||
# for #include "Arduino.h"
|
||||
VPATH += $(ARDUINO_CORES_DIR)
|
||||
|
||||
# for #include "pins_arduino.h"
|
||||
VPATH += $(ARDUINO_DIR)/variants/leonardo
|
||||
|
||||
# ad hoc workaround for compile problem on Windows:
|
||||
# Windows doesn't know difference between common/print.h and arduino/Print.h.
|
||||
# On Linux no problem.
|
||||
# Change file name common/print.h to console.h ?
|
||||
VPATH := $(TMK_DIR)/common $(VPATH)
|
||||
17
tmk_core/protocol/vusb/vusb.mk
Normal file
17
tmk_core/protocol/vusb/vusb.mk
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
VUSB_DIR = protocol/vusb
|
||||
|
||||
# Path to the V-USB library
|
||||
VUSB_PATH = $(LIB_PATH)/vusb
|
||||
|
||||
SRC += $(VUSB_DIR)/protocol.c \
|
||||
$(VUSB_DIR)/vusb.c \
|
||||
$(VUSB_DIR)/usb_util.c \
|
||||
$(VUSB_PATH)/usbdrv/usbdrv.c \
|
||||
$(VUSB_PATH)/usbdrv/usbdrvasm.S \
|
||||
$(VUSB_PATH)/usbdrv/oddebug.c
|
||||
|
||||
# Search Path
|
||||
VPATH += $(TMK_PATH)/$(VUSB_DIR)
|
||||
VPATH += $(VUSB_PATH)
|
||||
|
||||
OPT_DEFS += -DPROTOCOL_VUSB
|
||||
Loading…
Reference in a new issue