summaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-10-05 16:57:00 +0100
committerFlorian Didron <fdidron@users.noreply.github.com>2020-01-09 08:57:11 +0900
commitd1dc2d5389f5405dbc57e5b5531e08c955ea8ef1 (patch)
tree3a3cb2dc612a84e60368a9f904602a629e2f9175 /common_features.mk
parent9db7651e7bfb13b8e2ebbd95f4de61ea2658b1c8 (diff)
ARM - Initial backlight support (#6487)
* Move AVR backlight to own file, add borrowed ARM implementation * Tiny fix for backlight custom logic * Remove duplicate board from rebase * Fix f303 onekey example * clang-format * clang-format * Remove backlight keymap debug * Initial pass of ARM backlight docs * Initial pass of ARM backlight docs - resolve todos * fix rules validation logic * Add f072 warning * Add f072 warning * tidy up breathing in backlight keymap * tidy up breathing in backlight keymap * add missing break to backlight keymap
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk25
1 files changed, 19 insertions, 6 deletions
diff --git a/common_features.mk b/common_features.mk
index 401c8f43aa..abafd85f97 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -229,19 +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
-
- COMMON_VPATH += $(QUANTUM_DIR)/backlight
- SRC += $(QUANTUM_DIR)/backlight/backlight.c
- OPT_DEFS += -DBACKLIGHT_ENABLE
-
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
VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c