summaryrefslogtreecommitdiffstats
path: root/common_features.mk
diff options
context:
space:
mode:
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk101
1 files changed, 69 insertions, 32 deletions
diff --git a/common_features.mk b/common_features.mk
index e50207b0b4..6c3646db94 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -61,7 +61,7 @@ endif
ifeq ($(strip $(STENO_ENABLE)), yes)
OPT_DEFS += -DSTENO_ENABLE
- VIRTSER_ENABLE := yes
+ VIRTSER_ENABLE ?= yes
SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
endif
@@ -82,19 +82,19 @@ endif
ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE
- UNICODE_COMMON = yes
+ UNICODE_COMMON := yes
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
endif
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
OPT_DEFS += -DUNICODEMAP_ENABLE
- UNICODE_COMMON = yes
+ UNICODE_COMMON := yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
endif
ifeq ($(strip $(UNICODE_ENABLE)), yes)
OPT_DEFS += -DUNICODE_ENABLE
- UNICODE_COMMON = yes
+ UNICODE_COMMON := yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
endif
@@ -107,12 +107,13 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
OPT_DEFS += -DRGBLIGHT_ENABLE
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgblight.c
- CIE1931_CURVE = yes
- LED_BREATHING_TABLE = yes
+ CIE1931_CURVE := yes
+ LED_BREATHING_TABLE := yes
+ RGB_KEYCODES_ENABLE := yes
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
else
- WS2812_DRIVER_REQUIRED = yes
+ WS2812_DRIVER_REQUIRED := yes
endif
endif
@@ -146,11 +147,12 @@ endif
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgb_matrix.c
SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c
- CIE1931_CURVE = yes
+ CIE1931_CURVE := yes
+ RGB_KEYCODES_ENABLE := yes
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
- RGB_MATRIX_ENABLE = IS31FL3731
+ RGB_MATRIX_ENABLE := IS31FL3731
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
@@ -176,7 +178,7 @@ endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
OPT_DEFS += -DWS2812
- WS2812_DRIVER_REQUIRED = yes
+ WS2812_DRIVER_REQUIRED := yes
endif
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
@@ -187,6 +189,10 @@ ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes)
OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER
endif
+ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes)
+ SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c
+endif
+
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
OPT_DEFS += -DTAP_DANCE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
@@ -226,37 +232,36 @@ endif
endif
ifeq ($(strip $(LCD_ENABLE)), yes)
- CIE1931_CURVE = yes
+ CIE1931_CURVE := yes
endif
# backward compat
ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
- BACKLIGHT_ENABLE = custom
+ BACKLIGHT_DRIVER := custom
endif
-VALID_BACKLIGHT_TYPES := yes software custom
+VALID_BACKLIGHT_TYPES := pwm software custom
BACKLIGHT_ENABLE ?= no
-ifneq ($(strip $(BACKLIGHT_ENABLE)), no)
- ifeq ($(filter $(BACKLIGHT_ENABLE),$(VALID_BACKLIGHT_TYPES)),)
- $(error BACKLIGHT_ENABLE="$(BACKLIGHT_ENABLE)" is not a valid backlight type)
+BACKLIGHT_DRIVER ?= pwm
+ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
+ ifeq ($(filter $(BACKLIGHT_DRIVER),$(VALID_BACKLIGHT_TYPES)),)
+ $(error BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type)
endif
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
- CIE1931_CURVE = yes
+ CIE1931_CURVE := yes
endif
COMMON_VPATH += $(QUANTUM_DIR)/backlight
SRC += $(QUANTUM_DIR)/backlight/backlight.c
OPT_DEFS += -DBACKLIGHT_ENABLE
- ifeq ($(strip $(BACKLIGHT_ENABLE)), software)
+ ifeq ($(strip $(BACKLIGHT_DRIVER)), custom)
+ OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
+ else ifeq ($(strip $(BACKLIGHT_DRIVER)), software)
SRC += $(QUANTUM_DIR)/backlight/backlight_soft.c
else
- ifeq ($(strip $(BACKLIGHT_ENABLE)), custom)
- OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
- endif
-
ifeq ($(PLATFORM),AVR)
SRC += $(QUANTUM_DIR)/backlight/backlight_avr.c
else
@@ -273,6 +278,8 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
$(error WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver)
endif
+ OPT_DEFS += -DWS2812_DRIVER_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]'))
+
ifeq ($(strip $(WS2812_DRIVER)), bitbang)
SRC += ws2812.c
else
@@ -287,12 +294,12 @@ endif
ifeq ($(strip $(CIE1931_CURVE)), yes)
OPT_DEFS += -DUSE_CIE1931_CURVE
- LED_TABLES = yes
+ LED_TABLES := yes
endif
ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
OPT_DEFS += -DUSE_LED_BREATHING_TABLE
- LED_TABLES = yes
+ LED_TABLES := yes
endif
ifeq ($(strip $(LED_TABLES)), yes)
@@ -342,6 +349,14 @@ ifeq ($(strip $(VELOCIKEY_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/velocikey.c
endif
+ifeq ($(strip $(VIA_ENABLE)), yes)
+ DYNAMIC_KEYMAP_ENABLE := yes
+ RAW_ENABLE := yes
+ BOOTMAGIC_ENABLE := lite
+ SRC += $(QUANTUM_DIR)/via.c
+ OPT_DEFS += -DVIA_ENABLE
+endif
+
ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes)
OPT_DEFS += -DDYNAMIC_KEYMAP_ENABLE
SRC += $(QUANTUM_DIR)/dynamic_keymap.c
@@ -359,12 +374,28 @@ QUANTUM_SRC:= \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c
-# Include the standard or split matrix code if needed
+
+
+VALID_CUSTOM_MATRIX_TYPES:= yes lite no
+
+CUSTOM_MATRIX ?= no
+
ifneq ($(strip $(CUSTOM_MATRIX)), yes)
- ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
- QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
- else
- QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
+ ifeq ($(filter $(CUSTOM_MATRIX),$(VALID_CUSTOM_MATRIX_TYPES)),)
+ $(error CUSTOM_MATRIX="$(CUSTOM_MATRIX)" is not a valid custom matrix type)
+ endif
+
+ # Include common stuff for all non custom matrix users
+ QUANTUM_SRC += $(QUANTUM_DIR)/matrix_common.c
+
+ # if 'lite' then skip the actual matrix implementation
+ ifneq ($(strip $(CUSTOM_MATRIX)), lite)
+ # Include the standard or split matrix code if needed
+ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
+ QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
+ else
+ QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
+ endif
endif
endif
@@ -407,12 +438,18 @@ ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
OPT_DEFS += -DSPACE_CADET_ENABLE
endif
-ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
- SRC += $(QUANTUM_DIR)/dip_switch.c
- OPT_DEFS += -DDIP_SWITCH_ENABLE
+MAGIC_ENABLE ?= yes
+ifeq ($(strip $(MAGIC_ENABLE)), yes)
+ SRC += $(QUANTUM_DIR)/process_keycode/process_magic.c
+ OPT_DEFS += -DMAGIC_KEYCODE_ENABLE
endif
ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c
OPT_DEFS += -DDYNAMIC_MACRO_ENABLE
endif
+
+ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
+ SRC += $(QUANTUM_DIR)/dip_switch.c
+ OPT_DEFS += -DDIP_SWITCH_ENABLE
+endif