Convert backlight to follow driver rules pattern

daktil_manuform
zvecr 2019-11-05 23:44:43 +00:00
parent 80c2e26741
commit d4c23d881f
2 changed files with 9 additions and 10 deletions

View File

@ -231,15 +231,16 @@ endif
# backward compat # backward compat
ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
BACKLIGHT_ENABLE = custom BACKLIGHT_DRIVER = custom
endif endif
VALID_BACKLIGHT_TYPES := yes software custom VALID_BACKLIGHT_TYPES := pwm software custom
BACKLIGHT_ENABLE ?= no BACKLIGHT_ENABLE ?= no
ifneq ($(strip $(BACKLIGHT_ENABLE)), no) BACKLIGHT_DRIVER ?= pwm
ifeq ($(filter $(BACKLIGHT_ENABLE),$(VALID_BACKLIGHT_TYPES)),) ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
$(error BACKLIGHT_ENABLE="$(BACKLIGHT_ENABLE)" is not a valid backlight type) ifeq ($(filter $(BACKLIGHT_DRIVER),$(VALID_BACKLIGHT_TYPES)),)
$(error BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type)
endif endif
ifeq ($(strip $(VISUALIZER_ENABLE)), yes) ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
@ -250,10 +251,10 @@ ifneq ($(strip $(BACKLIGHT_ENABLE)), no)
SRC += $(QUANTUM_DIR)/backlight/backlight.c SRC += $(QUANTUM_DIR)/backlight/backlight.c
OPT_DEFS += -DBACKLIGHT_ENABLE OPT_DEFS += -DBACKLIGHT_ENABLE
ifeq ($(strip $(BACKLIGHT_ENABLE)), software) ifeq ($(strip $(BACKLIGHT_DRIVER)), software)
SRC += $(QUANTUM_DIR)/backlight/backlight_soft.c SRC += $(QUANTUM_DIR)/backlight/backlight_soft.c
else else
ifeq ($(strip $(BACKLIGHT_ENABLE)), custom) ifeq ($(strip $(BACKLIGHT_DRIVER)), custom)
OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
endif endif

View File

@ -5,9 +5,7 @@ AUDIO_ENABLE = yes
WS2812_DRIVER = bitbang WS2812_DRIVER = bitbang
# Force task driven PWM until ARM can provide automatic configuration # Force task driven PWM until ARM can provide automatic configuration
ifneq ($(strip $(BACKLIGHT_ENABLE)), no) BACKLIGHT_DRIVER = software
BACKLIGHT_ENABLE = software
endif
# The rest of these settings shouldn't change # The rest of these settings shouldn't change