diff options
Diffstat (limited to 'common_features.mk')
| -rw-r--r-- | common_features.mk | 40 | 
1 files changed, 28 insertions, 12 deletions
diff --git a/common_features.mk b/common_features.mk index 8c9d0a90c7..5a1231de49 100644 --- a/common_features.mk +++ b/common_features.mk @@ -223,14 +223,17 @@ VALID_LED_MATRIX_TYPES := IS31FL3731 custom  ifeq ($(strip $(LED_MATRIX_ENABLE)), yes)      ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),) -        $(error LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type) -    else -        BACKLIGHT_ENABLE = yes -        BACKLIGHT_DRIVER = custom -        OPT_DEFS += -DLED_MATRIX_ENABLE -        SRC += $(QUANTUM_DIR)/led_matrix.c -        SRC += $(QUANTUM_DIR)/led_matrix_drivers.c +        $(error "$(LED_MATRIX_DRIVER)" is not a valid matrix type)      endif +    OPT_DEFS += -DLED_MATRIX_ENABLE +ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162)) +    # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines +    OPT_DEFS += -DLIB8_ATTINY +endif +    SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c +    SRC += $(QUANTUM_DIR)/led_matrix.c +    SRC += $(QUANTUM_DIR)/led_matrix_drivers.c +    CIE1931_CURVE := yes      ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731)          OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE @@ -422,10 +425,6 @@ ifeq ($(strip $(TERMINAL_ENABLE)), yes)      OPT_DEFS += -DUSER_PRINT  endif -ifeq ($(strip $(USB_HID_ENABLE)), yes) -    include $(TMK_DIR)/protocol/usb_hid.mk -endif -  ifeq ($(strip $(WPM_ENABLE)), yes)      SRC += $(QUANTUM_DIR)/wpm.c      OPT_DEFS += -DWPM_ENABLE @@ -459,6 +458,23 @@ ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)      SRC += $(QUANTUM_DIR)/dip_switch.c  endif +VALID_MAGIC_TYPES := yes full lite +BOOTMAGIC_ENABLE ?= no +ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) +  ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),) +    $(error BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic) +  endif +  ifneq ($(strip $(BOOTMAGIC_ENABLE)), full) +      OPT_DEFS += -DBOOTMAGIC_LITE +      QUANTUM_SRC += $(QUANTUM_DIR)/bootmagic/bootmagic_lite.c +  else +    OPT_DEFS += -DBOOTMAGIC_ENABLE +    QUANTUM_SRC += $(QUANTUM_DIR)/bootmagic/bootmagic_full.c +  endif +endif +COMMON_VPATH += $(QUANTUM_DIR)/bootmagic +QUANTUM_SRC += $(QUANTUM_DIR)/bootmagic/magic.c +  VALID_CUSTOM_MATRIX_TYPES:= yes lite no  CUSTOM_MATRIX ?= no @@ -673,4 +689,4 @@ ifeq ($(strip $(USBPD_ENABLE)), yes)              # Board designers can add their own driver to $(SRC)          endif      endif -endif
\ No newline at end of file +endif  | 
