diff options
Diffstat (limited to 'common_features.mk')
-rw-r--r-- | common_features.mk | 69 |
1 files changed, 50 insertions, 19 deletions
diff --git a/common_features.mk b/common_features.mk index 1a9fd46b5..91e9154f4 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,13 @@ 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 |
232 | endif | 233 | endif |
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 |
240 | SRC += $(LIB_PATH)/lib8tion/lib8tion.c | ||
236 | CIE1931_CURVE := yes | 241 | CIE1931_CURVE := yes |
237 | 242 | ||
238 | ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731) | 243 | ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731) |
@@ -244,7 +249,7 @@ endif | |||
244 | endif | 249 | endif |
245 | 250 | ||
246 | RGB_MATRIX_ENABLE ?= no | 251 | RGB_MATRIX_ENABLE ?= no |
247 | VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom | 252 | VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom |
248 | 253 | ||
249 | ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) | 254 | ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) |
250 | ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) | 255 | ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) |
@@ -255,12 +260,23 @@ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) | |||
255 | # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines | 260 | # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines |
256 | OPT_DEFS += -DLIB8_ATTINY | 261 | OPT_DEFS += -DLIB8_ATTINY |
257 | endif | 262 | endif |
263 | COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix | ||
264 | COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations | ||
265 | COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations/runners | ||
258 | SRC += $(QUANTUM_DIR)/color.c | 266 | SRC += $(QUANTUM_DIR)/color.c |
259 | SRC += $(QUANTUM_DIR)/rgb_matrix.c | 267 | SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix.c |
260 | SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c | 268 | SRC += $(QUANTUM_DIR)/rgb_matrix/rgb_matrix_drivers.c |
269 | SRC += $(LIB_PATH)/lib8tion/lib8tion.c | ||
261 | CIE1931_CURVE := yes | 270 | CIE1931_CURVE := yes |
262 | RGB_KEYCODES_ENABLE := yes | 271 | RGB_KEYCODES_ENABLE := yes |
263 | 272 | ||
273 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), AW20216) | ||
274 | OPT_DEFS += -DAW20216 -DSTM32_SPI -DHAL_USE_SPI=TRUE | ||
275 | COMMON_VPATH += $(DRIVER_PATH)/awinic | ||
276 | SRC += aw20216.c | ||
277 | QUANTUM_LIB_SRC += spi_master.c | ||
278 | endif | ||
279 | |||
264 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731) | 280 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731) |
265 | OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE | 281 | OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE |
266 | COMMON_VPATH += $(DRIVER_PATH)/issi | 282 | COMMON_VPATH += $(DRIVER_PATH)/issi |
@@ -318,6 +334,11 @@ ifeq ($(strip $(PRINTING_ENABLE)), yes) | |||
318 | SRC += $(TMK_DIR)/protocol/serial_uart.c | 334 | SRC += $(TMK_DIR)/protocol/serial_uart.c |
319 | endif | 335 | endif |
320 | 336 | ||
337 | ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes) | ||
338 | OPT_DEFS += -DKEY_OVERRIDE_ENABLE | ||
339 | SRC += $(QUANTUM_DIR)/process_keycode/process_key_override.c | ||
340 | endif | ||
341 | |||
321 | ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) | 342 | ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) |
322 | SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c) | 343 | SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c) |
323 | SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) | 344 | SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) |
@@ -342,11 +363,6 @@ ifeq ($(strip $(LCD_ENABLE)), yes) | |||
342 | CIE1931_CURVE := yes | 363 | CIE1931_CURVE := yes |
343 | endif | 364 | endif |
344 | 365 | ||
345 | # backward compat | ||
346 | ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) | ||
347 | BACKLIGHT_DRIVER := custom | ||
348 | endif | ||
349 | |||
350 | VALID_BACKLIGHT_TYPES := pwm timer software custom | 366 | VALID_BACKLIGHT_TYPES := pwm timer software custom |
351 | 367 | ||
352 | BACKLIGHT_ENABLE ?= no | 368 | BACKLIGHT_ENABLE ?= no |
@@ -494,11 +510,7 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes) | |||
494 | # if 'lite' then skip the actual matrix implementation | 510 | # if 'lite' then skip the actual matrix implementation |
495 | ifneq ($(strip $(CUSTOM_MATRIX)), lite) | 511 | ifneq ($(strip $(CUSTOM_MATRIX)), lite) |
496 | # Include the standard or split matrix code if needed | 512 | # Include the standard or split matrix code if needed |
497 | ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | 513 | 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 | 514 | endif |
503 | endif | 515 | endif |
504 | 516 | ||
@@ -523,13 +535,18 @@ endif | |||
523 | ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | 535 | ifeq ($(strip $(SPLIT_KEYBOARD)), yes) |
524 | POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h | 536 | POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h |
525 | OPT_DEFS += -DSPLIT_KEYBOARD | 537 | OPT_DEFS += -DSPLIT_KEYBOARD |
538 | CRC_ENABLE := yes | ||
526 | 539 | ||
527 | # Include files used by all split keyboards | 540 | # Include files used by all split keyboards |
528 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c | 541 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c |
529 | 542 | ||
530 | # Determine which (if any) transport files are required | 543 | # Determine which (if any) transport files are required |
531 | ifneq ($(strip $(SPLIT_TRANSPORT)), custom) | 544 | ifneq ($(strip $(SPLIT_TRANSPORT)), custom) |
532 | QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/transport.c | 545 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c \ |
546 | $(QUANTUM_DIR)/split_common/transactions.c | ||
547 | |||
548 | OPT_DEFS += -DSPLIT_COMMON_TRANSACTIONS | ||
549 | |||
533 | # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called. | 550 | # 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. | 551 | # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. |
535 | ifeq ($(PLATFORM),AVR) | 552 | ifeq ($(PLATFORM),AVR) |
@@ -550,11 +567,17 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | |||
550 | COMMON_VPATH += $(QUANTUM_PATH)/split_common | 567 | COMMON_VPATH += $(QUANTUM_PATH)/split_common |
551 | endif | 568 | endif |
552 | 569 | ||
570 | ifeq ($(strip $(CRC_ENABLE)), yes) | ||
571 | OPT_DEFS += -DCRC_ENABLE | ||
572 | SRC += crc.c | ||
573 | endif | ||
574 | |||
553 | HAPTIC_ENABLE ?= no | 575 | HAPTIC_ENABLE ?= no |
554 | ifneq ($(strip $(HAPTIC_ENABLE)),no) | 576 | ifneq ($(strip $(HAPTIC_ENABLE)),no) |
555 | COMMON_VPATH += $(DRIVER_PATH)/haptic | 577 | COMMON_VPATH += $(DRIVER_PATH)/haptic |
556 | SRC += haptic.c | ||
557 | OPT_DEFS += -DHAPTIC_ENABLE | 578 | OPT_DEFS += -DHAPTIC_ENABLE |
579 | SRC += $(QUANTUM_DIR)/haptic.c | ||
580 | SRC += $(QUANTUM_DIR)/process_keycode/process_haptic.c | ||
558 | endif | 581 | endif |
559 | 582 | ||
560 | ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) | 583 | ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) |
@@ -580,6 +603,14 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) | |||
580 | SRC += oled_driver.c | 603 | SRC += oled_driver.c |
581 | endif | 604 | endif |
582 | 605 | ||
606 | ifeq ($(strip $(ST7565_ENABLE)), yes) | ||
607 | OPT_DEFS += -DST7565_ENABLE | ||
608 | COMMON_VPATH += $(DRIVER_PATH)/oled # For glcdfont.h | ||
609 | COMMON_VPATH += $(DRIVER_PATH)/lcd | ||
610 | QUANTUM_LIB_SRC += spi_master.c | ||
611 | SRC += st7565.c | ||
612 | endif | ||
613 | |||
583 | include $(DRIVER_PATH)/qwiic/qwiic.mk | 614 | include $(DRIVER_PATH)/qwiic/qwiic.mk |
584 | 615 | ||
585 | ifeq ($(strip $(UCIS_ENABLE)), yes) | 616 | ifeq ($(strip $(UCIS_ENABLE)), yes) |