From 7baa37c3dfed53825b5c499ee3681ad762941bc6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 28 Nov 2020 23:43:31 +1100 Subject: [PATCH] Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840) --- common_features.mk | 25 +++++++++++--------- docs/feature_led_matrix.md | 3 ++- docs/ja/feature_led_matrix.md | 3 ++- keyboards/clueboard/66_hotswap/gen1/rules.mk | 3 ++- keyboards/terrazzo/rules.mk | 3 ++- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/common_features.mk b/common_features.mk index e001233a3d..8ac53ec45a 100644 --- a/common_features.mk +++ b/common_features.mk @@ -168,12 +168,14 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif endif -VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom LED_MATRIX_ENABLE ?= no -ifneq ($(strip $(LED_MATRIX_ENABLE)), no) - ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),) - $(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type) +VALID_LED_MATRIX_TYPES := IS31FL3731 custom +# TODO: IS31FL3733 IS31FL3737 IS31FL3741 + +ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) + ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),) + $(error LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type) else BACKLIGHT_ENABLE = yes BACKLIGHT_DRIVER = custom @@ -181,19 +183,20 @@ ifneq ($(strip $(LED_MATRIX_ENABLE)), no) SRC += $(QUANTUM_DIR)/led_matrix.c SRC += $(QUANTUM_DIR)/led_matrix_drivers.c endif -endif -ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731) - OPT_DEFS += -DIS31FL3731 - COMMON_VPATH += $(DRIVER_PATH)/issi - SRC += is31fl3731-simple.c - QUANTUM_LIB_SRC += i2c_master.c + ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731) + OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE + COMMON_VPATH += $(DRIVER_PATH)/issi + SRC += is31fl3731-simple.c + QUANTUM_LIB_SRC += i2c_master.c + endif endif RGB_MATRIX_ENABLE ?= no +VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_MATRIX_TYPES)),) + ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) $(error "$(RGB_MATRIX_DRIVER)" is not a valid matrix type) endif OPT_DEFS += -DRGB_MATRIX_ENABLE diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index 372407b90c..a4e9d7eb83 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md @@ -10,7 +10,8 @@ If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_r There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`: - LED_MATRIX_ENABLE = IS31FL3731 + LED_MATRIX_ENABLE = yes + LED_MATRIX_DRIVER = IS31FL3731 You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`: diff --git a/docs/ja/feature_led_matrix.md b/docs/ja/feature_led_matrix.md index b2595f9989..e7b60f594b 100644 --- a/docs/ja/feature_led_matrix.md +++ b/docs/ja/feature_led_matrix.md @@ -15,7 +15,8 @@ RGB LED を使いたい場合は、代わりに [RGB マトリックスサブシ I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED マトリックスライトのための基本的なサポートがあります:有効にするには、`rules.mk` に以下を追加します: - LED_MATRIX_ENABLE = IS31FL3731 + LED_MATRIX_ENABLE = yes + LED_MATRIX_DRIVER = IS31FL3731 1から4個の IS31FL3731 IC を使うことができます。キーボード上に存在しない IC の `LED_DRIVER_ADDR_` 定義を指定しないでください。`config.h` に以下の項目を定義することができます: diff --git a/keyboards/clueboard/66_hotswap/gen1/rules.mk b/keyboards/clueboard/66_hotswap/gen1/rules.mk index c013268455..3667d63b76 100644 --- a/keyboards/clueboard/66_hotswap/gen1/rules.mk +++ b/keyboards/clueboard/66_hotswap/gen1/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F303 # LED Configuration -LED_MATRIX_ENABLE = IS31FL3731 +LED_MATRIX_ENABLE = yes +LED_MATRIX_DRIVER = IS31FL3731 # Build Options # comment out to disable the options. diff --git a/keyboards/terrazzo/rules.mk b/keyboards/terrazzo/rules.mk index f6ea149e3f..7a08fb769f 100644 --- a/keyboards/terrazzo/rules.mk +++ b/keyboards/terrazzo/rules.mk @@ -26,7 +26,8 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: htt AUDIO_ENABLE = no RGBLIGHT_ENABLE = no BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -LED_MATRIX_ENABLE = IS31FL3731 +LED_MATRIX_ENABLE = yes +LED_MATRIX_DRIVER = IS31FL3731 ENCODER_ENABLE = yes WPM_ENABLE = yes