]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - common_features.mk
Update README.md (#5135)
[qmk_firmware.git] / common_features.mk
index 8e2747d5a4e0de09df2547b582b6adf1ef837919..6f02dbac6298427ec96e328e9ae7c6f2ccf2b19b 100644 (file)
@@ -114,8 +114,27 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
     endif
 endif
 
-RGB_MATRIX_ENABLE ?= no
 VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 custom
+
+LED_MATRIX_ENABLE ?= no
+ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
+    ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
+        $(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type)
+    else
+        OPT_DEFS += -DLED_MATRIX_ENABLE -DBACKLIGHT_ENABLE -DBACKLIGHT_CUSTOM_DRIVER
+        SRC += $(QUANTUM_DIR)/led_matrix.c
+        SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
+    endif
+endif
+
+ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
+    OPT_DEFS += -DIS31FL3731
+    COMMON_VPATH += $(DRIVER_PATH)/issi
+    SRC += is31fl3731-simple.c
+    SRC += i2c_master.c
+endif
+
+RGB_MATRIX_ENABLE ?= no
 ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
 ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
     $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
@@ -191,7 +210,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
     ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
         CIE1931_CURVE = yes
     endif
-        ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
+    ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
         OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
     endif
 endif
@@ -265,14 +284,15 @@ endif
 
 DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce
 # Debounce Modules. If implemented in matrix.c, don't use these.
-ifeq ($(strip $(DEBOUNCE_TYPE)), custom)
-    # Do nothing. do your debouncing in matrix.c
-else ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g)
+DEBOUNCE_TYPE?= sym_g
+VALID_DEBOUNCE_TYPES := sym_g eager_pk custom
+ifeq ($(filter $(DEBOUNCE_TYPE),$(VALID_DEBOUNCE_TYPES)),)
+    $(error DEBOUNCE_TYPE="$(DEBOUNCE_TYPE)" is not a valid debounce algorithm)
+endif
+ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g)
     QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c
 else ifeq ($(strip $(DEBOUNCE_TYPE)), eager_pk)
     QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_eager_pk.c
-else # default algorithm. Won't be used if we have a custom_matrix that doesn't utilize it
-    QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c
 endif