]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - common_features.mk
[Keyboard] Add Phoebe, a keyboard by Maxr1998 (#6870)
[qmk_firmware.git] / common_features.mk
index 79af8a2256c923241b5189e3f8b2e760ad8a431c..05a99fc63c8414bcb88ebd9c7a67c58ed08c7b62 100644 (file)
@@ -229,13 +229,32 @@ ifeq ($(strip $(LCD_ENABLE)), yes)
     CIE1931_CURVE = yes
 endif
 
-ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
+# backward compat
+ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
+    BACKLIGHT_ENABLE = custom
+endif
+
+VALID_BACKLIGHT_TYPES := yes custom
+
+BACKLIGHT_ENABLE ?= no
+ifneq ($(strip $(BACKLIGHT_ENABLE)), no)
+    ifeq ($(filter $(BACKLIGHT_ENABLE),$(VALID_BACKLIGHT_TYPES)),)
+        $(error BACKLIGHT_ENABLE="$(BACKLIGHT_ENABLE)" is not a valid backlight type)
+    endif
+
     ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
         CIE1931_CURVE = yes
     endif
-    ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
+
+    ifeq ($(strip $(BACKLIGHT_ENABLE)), custom)
         OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
     endif
+
+    ifeq ($(PLATFORM),AVR)
+        SRC += $(QUANTUM_DIR)/backlight/backlight_avr.c
+    else
+        SRC += $(QUANTUM_DIR)/backlight/backlight_arm.c
+    endif
 endif
 
 ifeq ($(strip $(CIE1931_CURVE)), yes)