diff options
Diffstat (limited to 'common_features.mk')
-rw-r--r-- | common_features.mk | 81 |
1 files changed, 56 insertions, 25 deletions
diff --git a/common_features.mk b/common_features.mk index 1a9fd46b5..75a9e1f2e 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,21 +231,25 @@ 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) |
239 | OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE | 244 | OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE |
240 | COMMON_VPATH += $(DRIVER_PATH)/issi | 245 | COMMON_VPATH += $(DRIVER_PATH)/led/issi |
241 | SRC += is31fl3731-simple.c | 246 | SRC += is31fl3731-simple.c |
242 | QUANTUM_LIB_SRC += i2c_master.c | 247 | QUANTUM_LIB_SRC += i2c_master.c |
243 | endif | 248 | 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,36 +260,47 @@ 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)/led | ||
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)/led/issi |
267 | SRC += is31fl3731.c | 283 | SRC += is31fl3731.c |
268 | QUANTUM_LIB_SRC += i2c_master.c | 284 | QUANTUM_LIB_SRC += i2c_master.c |
269 | endif | 285 | endif |
270 | 286 | ||
271 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3733) | 287 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3733) |
272 | OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE | 288 | OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE |
273 | COMMON_VPATH += $(DRIVER_PATH)/issi | 289 | COMMON_VPATH += $(DRIVER_PATH)/led/issi |
274 | SRC += is31fl3733.c | 290 | SRC += is31fl3733.c |
275 | QUANTUM_LIB_SRC += i2c_master.c | 291 | QUANTUM_LIB_SRC += i2c_master.c |
276 | endif | 292 | endif |
277 | 293 | ||
278 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3737) | 294 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3737) |
279 | OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE | 295 | OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE |
280 | COMMON_VPATH += $(DRIVER_PATH)/issi | 296 | COMMON_VPATH += $(DRIVER_PATH)/led/issi |
281 | SRC += is31fl3737.c | 297 | SRC += is31fl3737.c |
282 | QUANTUM_LIB_SRC += i2c_master.c | 298 | QUANTUM_LIB_SRC += i2c_master.c |
283 | endif | 299 | endif |
284 | 300 | ||
285 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3741) | 301 | ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3741) |
286 | OPT_DEFS += -DIS31FL3741 -DSTM32_I2C -DHAL_USE_I2C=TRUE | 302 | OPT_DEFS += -DIS31FL3741 -DSTM32_I2C -DHAL_USE_I2C=TRUE |
287 | COMMON_VPATH += $(DRIVER_PATH)/issi | 303 | COMMON_VPATH += $(DRIVER_PATH)/led/issi |
288 | SRC += is31fl3741.c | 304 | SRC += is31fl3741.c |
289 | QUANTUM_LIB_SRC += i2c_master.c | 305 | QUANTUM_LIB_SRC += i2c_master.c |
290 | endif | 306 | endif |
@@ -342,11 +358,6 @@ ifeq ($(strip $(LCD_ENABLE)), yes) | |||
342 | CIE1931_CURVE := yes | 358 | CIE1931_CURVE := yes |
343 | endif | 359 | endif |
344 | 360 | ||
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 | 361 | VALID_BACKLIGHT_TYPES := pwm timer software custom |
351 | 362 | ||
352 | BACKLIGHT_ENABLE ?= no | 363 | BACKLIGHT_ENABLE ?= no |
@@ -406,7 +417,7 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) | |||
406 | endif | 417 | endif |
407 | 418 | ||
408 | ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) | 419 | ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes) |
409 | COMMON_VPATH += $(DRIVER_PATH)/apa102 | 420 | COMMON_VPATH += $(DRIVER_PATH)/led |
410 | SRC += apa102.c | 421 | SRC += apa102.c |
411 | endif | 422 | endif |
412 | 423 | ||
@@ -494,11 +505,7 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes) | |||
494 | # if 'lite' then skip the actual matrix implementation | 505 | # if 'lite' then skip the actual matrix implementation |
495 | ifneq ($(strip $(CUSTOM_MATRIX)), lite) | 506 | ifneq ($(strip $(CUSTOM_MATRIX)), lite) |
496 | # Include the standard or split matrix code if needed | 507 | # Include the standard or split matrix code if needed |
497 | ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | 508 | 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 | 509 | endif |
503 | endif | 510 | endif |
504 | 511 | ||
@@ -523,13 +530,18 @@ endif | |||
523 | ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | 530 | ifeq ($(strip $(SPLIT_KEYBOARD)), yes) |
524 | POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h | 531 | POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h |
525 | OPT_DEFS += -DSPLIT_KEYBOARD | 532 | OPT_DEFS += -DSPLIT_KEYBOARD |
533 | CRC_ENABLE := yes | ||
526 | 534 | ||
527 | # Include files used by all split keyboards | 535 | # Include files used by all split keyboards |
528 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c | 536 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c |
529 | 537 | ||
530 | # Determine which (if any) transport files are required | 538 | # Determine which (if any) transport files are required |
531 | ifneq ($(strip $(SPLIT_TRANSPORT)), custom) | 539 | ifneq ($(strip $(SPLIT_TRANSPORT)), custom) |
532 | QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/transport.c | 540 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c \ |
541 | $(QUANTUM_DIR)/split_common/transactions.c | ||
542 | |||
543 | OPT_DEFS += -DSPLIT_COMMON_TRANSACTIONS | ||
544 | |||
533 | # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called. | 545 | # 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. | 546 | # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. |
535 | ifeq ($(PLATFORM),AVR) | 547 | ifeq ($(PLATFORM),AVR) |
@@ -550,11 +562,17 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | |||
550 | COMMON_VPATH += $(QUANTUM_PATH)/split_common | 562 | COMMON_VPATH += $(QUANTUM_PATH)/split_common |
551 | endif | 563 | endif |
552 | 564 | ||
565 | ifeq ($(strip $(CRC_ENABLE)), yes) | ||
566 | OPT_DEFS += -DCRC_ENABLE | ||
567 | SRC += crc.c | ||
568 | endif | ||
569 | |||
553 | HAPTIC_ENABLE ?= no | 570 | HAPTIC_ENABLE ?= no |
554 | ifneq ($(strip $(HAPTIC_ENABLE)),no) | 571 | ifneq ($(strip $(HAPTIC_ENABLE)),no) |
555 | COMMON_VPATH += $(DRIVER_PATH)/haptic | 572 | COMMON_VPATH += $(DRIVER_PATH)/haptic |
556 | SRC += haptic.c | ||
557 | OPT_DEFS += -DHAPTIC_ENABLE | 573 | OPT_DEFS += -DHAPTIC_ENABLE |
574 | SRC += $(QUANTUM_DIR)/haptic.c | ||
575 | SRC += $(QUANTUM_DIR)/process_keycode/process_haptic.c | ||
558 | endif | 576 | endif |
559 | 577 | ||
560 | ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) | 578 | ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) |
@@ -580,6 +598,14 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) | |||
580 | SRC += oled_driver.c | 598 | SRC += oled_driver.c |
581 | endif | 599 | endif |
582 | 600 | ||
601 | ifeq ($(strip $(ST7565_ENABLE)), yes) | ||
602 | OPT_DEFS += -DST7565_ENABLE | ||
603 | COMMON_VPATH += $(DRIVER_PATH)/oled # For glcdfont.h | ||
604 | COMMON_VPATH += $(DRIVER_PATH)/lcd | ||
605 | QUANTUM_LIB_SRC += spi_master.c | ||
606 | SRC += st7565.c | ||
607 | endif | ||
608 | |||
583 | include $(DRIVER_PATH)/qwiic/qwiic.mk | 609 | include $(DRIVER_PATH)/qwiic/qwiic.mk |
584 | 610 | ||
585 | ifeq ($(strip $(UCIS_ENABLE)), yes) | 611 | ifeq ($(strip $(UCIS_ENABLE)), yes) |
@@ -632,6 +658,11 @@ ifeq ($(strip $(COMBO_ENABLE)), yes) | |||
632 | OPT_DEFS += -DCOMBO_ENABLE | 658 | OPT_DEFS += -DCOMBO_ENABLE |
633 | endif | 659 | endif |
634 | 660 | ||
661 | ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes) | ||
662 | SRC += $(QUANTUM_DIR)/process_keycode/process_key_override.c | ||
663 | OPT_DEFS += -DKEY_OVERRIDE_ENABLE | ||
664 | endif | ||
665 | |||
635 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) | 666 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) |
636 | SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c | 667 | SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c |
637 | OPT_DEFS += -DTAP_DANCE_ENABLE | 668 | OPT_DEFS += -DTAP_DANCE_ENABLE |