aboutsummaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk59
1 files changed, 46 insertions, 13 deletions
diff --git a/common_features.mk b/common_features.mk
index 1a9fd46b5..f07110340 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -196,10 +196,11 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
196 ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),) 196 ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),)
197 $(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type) 197 $(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type)
198 else 198 else
199 POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h 199 COMMON_VPATH += $(QUANTUM_DIR)/rgblight
200 POST_CONFIG_H += $(QUANTUM_DIR)/rgblight/rgblight_post_config.h
200 OPT_DEFS += -DRGBLIGHT_ENABLE 201 OPT_DEFS += -DRGBLIGHT_ENABLE
201 SRC += $(QUANTUM_DIR)/color.c 202 SRC += $(QUANTUM_DIR)/color.c
202 SRC += $(QUANTUM_DIR)/rgblight.c 203 SRC += $(QUANTUM_DIR)/rgblight/rgblight.c
203 CIE1931_CURVE := yes 204 CIE1931_CURVE := yes
204 RGB_KEYCODES_ENABLE := yes 205 RGB_KEYCODES_ENABLE := yes
205 endif 206 endif
@@ -230,9 +231,12 @@ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162))
230 # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines 231 # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
231 OPT_DEFS += -DLIB8_ATTINY 232 OPT_DEFS += -DLIB8_ATTINY
232endif 233endif
234 COMMON_VPATH += $(QUANTUM_DIR)/led_matrix
235 COMMON_VPATH += $(QUANTUM_DIR)/led_matrix/animations
236 COMMON_VPATH += $(QUANTUM_DIR)/led_matrix/animations/runners
233 SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c 237 SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c
234 SRC += $(QUANTUM_DIR)/led_matrix.c 238 SRC += $(QUANTUM_DIR)/led_matrix/led_matrix.c
235 SRC += $(QUANTUM_DIR)/led_matrix_drivers.c 239 SRC += $(QUANTUM_DIR)/led_matrix/led_matrix_drivers.c
236 CIE1931_CURVE := yes 240 CIE1931_CURVE := yes
237 241
238 ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731) 242 ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731)
@@ -244,7 +248,7 @@ endif
244endif 248endif
245 249
246RGB_MATRIX_ENABLE ?= no 250RGB_MATRIX_ENABLE ?= no
247VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom 251VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
248 252
249ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) 253ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
250 ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) 254 ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),)
@@ -255,12 +259,22 @@ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162))
255 # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines 259 # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
256 OPT_DEFS += -DLIB8_ATTINY 260 OPT_DEFS += -DLIB8_ATTINY
257endif 261endif
262 COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix
263 COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations
264 COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations/runners
258 SRC += $(QUANTUM_DIR)/color.c 265 SRC += $(QUANTUM_DIR)/color.c
259 SRC += $(QUANTUM_DIR)/rgb_matrix.c 266 SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix.c
260 SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c 267 SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix_drivers.c
261 CIE1931_CURVE := yes 268 CIE1931_CURVE := yes
262 RGB_KEYCODES_ENABLE := yes 269 RGB_KEYCODES_ENABLE := yes
263 270
271 ifeq ($(strip $(RGB_MATRIX_DRIVER)), AW20216)
272 OPT_DEFS += -DAW20216 -DSTM32_SPI -DHAL_USE_SPI=TRUE
273 COMMON_VPATH += $(DRIVER_PATH)/awinic
274 SRC += aw20216.c
275 QUANTUM_LIB_SRC += spi_master.c
276 endif
277
264 ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731) 278 ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731)
265 OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE 279 OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
266 COMMON_VPATH += $(DRIVER_PATH)/issi 280 COMMON_VPATH += $(DRIVER_PATH)/issi
@@ -318,6 +332,11 @@ ifeq ($(strip $(PRINTING_ENABLE)), yes)
318 SRC += $(TMK_DIR)/protocol/serial_uart.c 332 SRC += $(TMK_DIR)/protocol/serial_uart.c
319endif 333endif
320 334
335ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
336 OPT_DEFS += -DKEY_OVERRIDE_ENABLE
337 SRC += $(QUANTUM_DIR)/process_keycode/process_key_override.c
338endif
339
321ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) 340ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
322 SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c) 341 SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
323 SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) 342 SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
@@ -494,11 +513,7 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes)
494 # if 'lite' then skip the actual matrix implementation 513 # if 'lite' then skip the actual matrix implementation
495 ifneq ($(strip $(CUSTOM_MATRIX)), lite) 514 ifneq ($(strip $(CUSTOM_MATRIX)), lite)
496 # Include the standard or split matrix code if needed 515 # Include the standard or split matrix code if needed
497 ifeq ($(strip $(SPLIT_KEYBOARD)), yes) 516 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
498 QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
499 else
500 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
501 endif
502 endif 517 endif
503endif 518endif
504 519
@@ -523,13 +538,18 @@ endif
523ifeq ($(strip $(SPLIT_KEYBOARD)), yes) 538ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
524 POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h 539 POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
525 OPT_DEFS += -DSPLIT_KEYBOARD 540 OPT_DEFS += -DSPLIT_KEYBOARD
541 CRC_ENABLE := yes
526 542
527 # Include files used by all split keyboards 543 # Include files used by all split keyboards
528 QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c 544 QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c
529 545
530 # Determine which (if any) transport files are required 546 # Determine which (if any) transport files are required
531 ifneq ($(strip $(SPLIT_TRANSPORT)), custom) 547 ifneq ($(strip $(SPLIT_TRANSPORT)), custom)
532 QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/transport.c 548 QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c \
549 $(QUANTUM_DIR)/split_common/transactions.c
550
551 OPT_DEFS += -DSPLIT_COMMON_TRANSACTIONS
552
533 # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called. 553 # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called.
534 # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. 554 # Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
535 ifeq ($(PLATFORM),AVR) 555 ifeq ($(PLATFORM),AVR)
@@ -550,6 +570,11 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
550 COMMON_VPATH += $(QUANTUM_PATH)/split_common 570 COMMON_VPATH += $(QUANTUM_PATH)/split_common
551endif 571endif
552 572
573ifeq ($(strip $(CRC_ENABLE)), yes)
574 OPT_DEFS += -DCRC_ENABLE
575 SRC += crc.c
576endif
577
553HAPTIC_ENABLE ?= no 578HAPTIC_ENABLE ?= no
554ifneq ($(strip $(HAPTIC_ENABLE)),no) 579ifneq ($(strip $(HAPTIC_ENABLE)),no)
555 COMMON_VPATH += $(DRIVER_PATH)/haptic 580 COMMON_VPATH += $(DRIVER_PATH)/haptic
@@ -580,6 +605,14 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
580 SRC += oled_driver.c 605 SRC += oled_driver.c
581endif 606endif
582 607
608ifeq ($(strip $(ST7565_ENABLE)), yes)
609 OPT_DEFS += -DST7565_ENABLE
610 COMMON_VPATH += $(DRIVER_PATH)/oled # For glcdfont.h
611 COMMON_VPATH += $(DRIVER_PATH)/lcd
612 QUANTUM_LIB_SRC += spi_master.c
613 SRC += st7565.c
614endif
615
583include $(DRIVER_PATH)/qwiic/qwiic.mk 616include $(DRIVER_PATH)/qwiic/qwiic.mk
584 617
585ifeq ($(strip $(UCIS_ENABLE)), yes) 618ifeq ($(strip $(UCIS_ENABLE)), yes)