]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Convert backlight to follow driver rules pattern
authorzvecr <git@zvecr.com>
Tue, 5 Nov 2019 23:44:43 +0000 (23:44 +0000)
committerzvecr <git@zvecr.com>
Sat, 14 Dec 2019 03:25:06 +0000 (03:25 +0000)
common_features.mk
quantum/stm32/proton_c.mk

index 1c814286c76a8bbb146de508d550cb27d1ef464d..9b60eeed03af00913e2bf29380b82e512dd4eacc 100644 (file)
@@ -231,15 +231,16 @@ endif
 
 # backward compat
 ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
-    BACKLIGHT_ENABLE = custom
+    BACKLIGHT_DRIVER = custom
 endif
 
-VALID_BACKLIGHT_TYPES := yes software custom
+VALID_BACKLIGHT_TYPES := pwm software 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)
+BACKLIGHT_DRIVER ?= pwm
+ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
+    ifeq ($(filter $(BACKLIGHT_DRIVER),$(VALID_BACKLIGHT_TYPES)),)
+        $(error BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type)
     endif
 
     ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
@@ -250,10 +251,10 @@ ifneq ($(strip $(BACKLIGHT_ENABLE)), no)
     SRC += $(QUANTUM_DIR)/backlight/backlight.c
     OPT_DEFS += -DBACKLIGHT_ENABLE
 
-    ifeq ($(strip $(BACKLIGHT_ENABLE)), software)
+    ifeq ($(strip $(BACKLIGHT_DRIVER)), software)
         SRC += $(QUANTUM_DIR)/backlight/backlight_soft.c
     else
-        ifeq ($(strip $(BACKLIGHT_ENABLE)), custom)
+        ifeq ($(strip $(BACKLIGHT_DRIVER)), custom)
             OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
         endif
 
index ff28a4cb5d585694283a0aeeb4ee74fdce081e0d..b25b5550458e3e5a8b7c532d89355542863ec82a 100644 (file)
@@ -5,9 +5,7 @@ AUDIO_ENABLE = yes
 WS2812_DRIVER = bitbang
 
 # Force task driven PWM until ARM can provide automatic configuration
-ifneq ($(strip $(BACKLIGHT_ENABLE)), no)
-       BACKLIGHT_ENABLE = software
-endif
+BACKLIGHT_DRIVER = software
 
 # The rest of these settings shouldn't change