+
+ COMMON_VPATH += $(QUANTUM_DIR)/backlight
+ SRC += $(QUANTUM_DIR)/backlight/backlight.c
+ OPT_DEFS += -DBACKLIGHT_ENABLE
+
+ ifeq ($(strip $(BACKLIGHT_ENABLE)), software)
+ SRC += $(QUANTUM_DIR)/backlight/backlight_soft.c
+ else
+ 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
+endif
+
+VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c
+
+WS2812_DRIVER ?= bitbang
+ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
+ ifeq ($(filter $(WS2812_DRIVER),$(VALID_WS2812_DRIVER_TYPES)),)
+ $(error WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver)
+ endif
+
+ ifeq ($(strip $(WS2812_DRIVER)), bitbang)
+ SRC += ws2812.c
+ else
+ SRC += ws2812_$(strip $(WS2812_DRIVER)).c
+ endif
+
+ # add extra deps
+ ifeq ($(strip $(WS2812_DRIVER)), i2c)
+ QUANTUM_LIB_SRC += i2c_master.c