From 2cf6236155d3e02f8a12a6f485d04b34b3e657ec Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 3 Nov 2020 10:24:56 +1100 Subject: [PATCH 1/4] Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER --- common_features.mk | 19 ++++++++++--------- 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, 18 insertions(+), 13 deletions(-) diff --git a/common_features.mk b/common_features.mk index e001233a3d9b..e5bfdf72b26f 100644 --- a/common_features.mk +++ b/common_features.mk @@ -171,9 +171,10 @@ 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) + +ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) + ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_MATRIX_TYPES)),) + $(error LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type) else BACKLIGHT_ENABLE = yes BACKLIGHT_DRIVER = custom @@ -181,13 +182,13 @@ 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 diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index 372407b90c2a..a4e9d7eb8369 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 b2595f9989e8..e7b60f594b45 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 c013268455c0..3667d63b76ab 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 f6ea149e3f1b..7a08fb769f38 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 From 8ea17eb7d4c8ea9e522b7088b27711180f60128f Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 28 Nov 2020 22:35:52 +1100 Subject: [PATCH 2/4] Split VALID_MATRIX_TYPES into LED Matrix and RGB Matrix --- common_features.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common_features.mk b/common_features.mk index e5bfdf72b26f..3d59f4748193 100644 --- a/common_features.mk +++ b/common_features.mk @@ -168,12 +168,12 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif endif -VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom LED_MATRIX_ENABLE ?= no +VALID_LED_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 custom ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) - ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_MATRIX_TYPES)),) + 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 @@ -192,9 +192,10 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) endif RGB_MATRIX_ENABLE ?= no +VALID_RGB_MATRIX_TYPES := yes 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 From 87fdc0653b5bd87953aca567a383288d41181cda Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 28 Nov 2020 22:46:15 +1100 Subject: [PATCH 3/4] `yes` is no longer a valid value --- common_features.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common_features.mk b/common_features.mk index 3d59f4748193..9f138b87dde2 100644 --- a/common_features.mk +++ b/common_features.mk @@ -170,7 +170,7 @@ endif LED_MATRIX_ENABLE ?= no -VALID_LED_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 custom +VALID_LED_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 custom ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),) @@ -192,7 +192,7 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) endif RGB_MATRIX_ENABLE ?= no -VALID_RGB_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom +VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) From 27580ebf3f28f49a94258e1bf8ed8cab688a3d7d Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 28 Nov 2020 22:48:03 +1100 Subject: [PATCH 4/4] Only 3731 is currently implemented for LED matrix --- common_features.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common_features.mk b/common_features.mk index 9f138b87dde2..8ac53ec45a5f 100644 --- a/common_features.mk +++ b/common_features.mk @@ -170,7 +170,8 @@ endif LED_MATRIX_ENABLE ?= no -VALID_LED_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 custom +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)),)