2022-04-04 00:17:38 +06:00
|
|
|
# Note for new boards -- CTPC and CONVERT_TO_PROTON_C are deprecated terms
|
|
|
|
# and should not be replicated for new boards. These will be removed from
|
|
|
|
# documentation as well as existing keymaps in due course.
|
2023-01-12 04:44:55 +06:00
|
|
|
ifneq ($(findstring yes, $(CTPC)$(CONVERT_TO_PROTON_C)),)
|
|
|
|
$(call CATASTROPHIC_ERROR,The `CONVERT_TO_PROTON_C` and `CTPC` options are now deprecated. `CONVERT_TO=proton_c` should be used instead.)
|
2022-04-03 23:22:52 +06:00
|
|
|
endif
|
|
|
|
|
|
|
|
# TODO: opt in rather than assume everything uses a pro micro
|
|
|
|
PIN_COMPATIBLE ?= promicro
|
|
|
|
ifneq ($(CONVERT_TO),)
|
|
|
|
# glob to search each platfrorm and/or check for valid converter
|
|
|
|
CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/)
|
|
|
|
ifeq ($(CONVERTER),)
|
|
|
|
$(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
TARGET := $(TARGET)_$(CONVERT_TO)
|
|
|
|
|
|
|
|
# Configure any defaults
|
|
|
|
OPT_DEFS += -DCONVERT_TO_$(strip $(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]'))
|
2022-10-08 22:13:58 +06:00
|
|
|
OPT_DEFS += -DCONVERTER_TARGET=\"$(strip $(CONVERT_TO))\"
|
2022-04-03 23:22:52 +06:00
|
|
|
OPT_DEFS += -DCONVERTER_ENABLED
|
|
|
|
VPATH += $(CONVERTER)
|
|
|
|
|
|
|
|
# Finally run any converter specific logic
|
|
|
|
include $(CONVERTER)/converter.mk
|
|
|
|
endif
|