From 37bfb20be6d584d7d039aa2cc5aee1f40403b8d3 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sat, 30 Jan 2021 13:08:58 -0800 Subject: [PATCH] Add a _SUPPORTED flag (#9058) * Initial attempt at allowing keyboards to indicate what features they do not support * try to use a for loop instead * Update disable_features.mk Co-authored-by: Drashna Jaelre * add a few more features * remove my test fixture * disable things that make all:all suggested" Co-authored-by: Zach White Co-authored-by: Drashna Jaelre --- build_keyboard.mk | 3 +++ disable_features.mk | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 disable_features.mk diff --git a/build_keyboard.mk b/build_keyboard.mk index 2b725ea68d4b..fdc17c907dc2 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -283,6 +283,9 @@ ifneq ("$(wildcard $(USER_PATH)/config.h)","") CONFIG_H += $(USER_PATH)/config.h endif +# Disable features that a keyboard doesn't support +-include disable_features.mk + # Object files directory # To put object files in current directory, use a dot (.), do NOT make # this an empty or blank macro! diff --git a/disable_features.mk b/disable_features.mk new file mode 100644 index 000000000000..84d8316eac9c --- /dev/null +++ b/disable_features.mk @@ -0,0 +1,31 @@ +# Unconditionally disable features that a keyboard advertises it doesn't support + +FEATURE_NAMES := +FEATURE_NAMES += ADAFRUIT_BLE +FEATURE_NAMES += AUDIO +FEATURE_NAMES += BACKLIGHT +FEATURE_NAMES += BLUETOOTH +FEATURE_NAMES += DIP_SWITCH +FEATURE_NAMES += DYNAMIC_KEYMAP +FEATURE_NAMES += ENCODER +FEATURE_NAMES += HAPTIC +FEATURE_NAMES += HD44780 +FEATURE_NAMES += IOS_DEVICE +FEATURE_NAMES += LCD_BACKLIGHT +FEATURE_NAMES += LCD +FEATURE_NAMES += OLED +FEATURE_NAMES += POINTING_DEVICE +FEATURE_NAMES += PRINTING +FEATURE_NAMES += PS2_MOUSE +FEATURE_NAMES += RGBLIGHT +FEATURE_NAMES += RGB_MATRIX +FEATURE_NAMES += SLEEP_LED +FEATURE_NAMES += SERIAL_LINK +FEATURE_NAMES += STENO +FEATURE_NAMES += SWAP_HANDS +FEATURE_NAMES += VISUALIZER +FEATURE_NAMES += WATCHDOG +FEATURE_NAMES += XT + +$(foreach AFEATURE,$(FEATURE_NAMES),\ + $(if $(filter $($(AFEATURE)_SUPPORTED),no),$(eval $(AFEATURE)_ENABLE=no)))