From 73758d3d3a3bbee76bd1c9946d4c663c28f166f0 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 20 Dec 2023 13:31:39 +1100 Subject: [PATCH] Rename `LED_DISABLE_WHEN_USB_SUSPENDED` -> `LED_MATRIX_SLEEP` (#22681) --- data/mappings/info_config.hjson | 5 +++-- docs/feature_led_matrix.md | 2 +- keyboards/input_club/ergodox_infinity/config.h | 2 +- keyboards/input_club/whitefox/config.h | 2 +- keyboards/keychron/c1_pro/ansi/white/config.h | 2 +- keyboards/keychron/c2_pro/ansi/white/config.h | 2 +- keyboards/keychron/s1/ansi/white/config.h | 2 +- keyboards/terrazzo/config.h | 2 +- quantum/led_matrix/led_matrix.c | 2 +- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson index a323865fec4..52747c4a5aa 100644 --- a/data/mappings/info_config.hjson +++ b/data/mappings/info_config.hjson @@ -74,12 +74,12 @@ "LEADER_TIMEOUT": {"info_key": "leader_key.timeout", "value_type": "int"}, // LED Matrix - "LED_DISABLE_WHEN_USB_SUSPENDED": {"info_key": "led_matrix.sleep", "value_type": "bool"}, "LED_MATRIX_CENTER": {"info_key": "led_matrix.center_point", "value_type": "array.int"}, "LED_MATRIX_KEYRELEASES": {"info_key": "led_matrix.react_on_keyup", "value_type": "bool"}, "LED_MATRIX_LED_FLUSH_LIMIT": {"info_key": "led_matrix.led_flush_limit", "value_type": "int"}, "LED_MATRIX_LED_PROCESS_LIMIT": {"info_key": "led_matrix.led_process_limit", "value_type": "int", "to_json": false}, "LED_MATRIX_MAXIMUM_BRIGHTNESS": {"info_key": "led_matrix.max_brightness", "value_type": "int"}, + "LED_MATRIX_SLEEP": {"info_key": "led_matrix.sleep", "value_type": "bool"}, "LED_MATRIX_SPD_STEP": {"info_key": "led_matrix.speed_steps", "value_type": "int"}, "LED_MATRIX_SPLIT": {"info_key": "led_matrix.split_count", "value_type": "array.int"}, "LED_MATRIX_TIMEOUT": {"info_key": "led_matrix.timeout", "value_type": "int"}, @@ -218,7 +218,8 @@ "DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true, "replace_with": "DEBOUNCE"}, "DESCRIPTION": {"info_key": "_invalid.usb_description", "invalid": true}, "IGNORE_MOD_TAP_INTERRUPT": {"info_key": "_invalid.ignore_mod_tap_interrupt", "value_type": "bool", "invalid": true}, - "IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "_invalid.ignore_mod_tap_interrupt_per_key", "invalid": true} + "IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "_invalid.ignore_mod_tap_interrupt_per_key", "invalid": true}, + "LED_DISABLE_WHEN_USB_SUSPENDED": {"info_key": "_invalid.led_matrix_sleep", "invalid": true, "replace_with": "LED_MATRIX_SLEEP"}, "NO_ACTION_FUNCTION": {"info_key": "_invalid.no_action_function", "invalid": true}, "NO_ACTION_MACRO": {"info_key": "_invalid.no_action_macro", "invalid": true}, "PREVENT_STUCK_MODIFIERS": {"info_key": "_invalid.prevent_stuck_mods", "invalid": true}, diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index d803fcf101e..9b23ce88844 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md @@ -357,7 +357,7 @@ For inspiration and examples, check out the built-in effects under `quantum/led_ ```c #define LED_MATRIX_KEYRELEASES // reactive effects respond to keyreleases (instead of keypresses) #define LED_MATRIX_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off -#define LED_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +#define LED_MATRIX_SLEEP // turn off effects when suspended #define LED_MATRIX_LED_PROCESS_LIMIT (LED_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) #define LED_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) #define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs diff --git a/keyboards/input_club/ergodox_infinity/config.h b/keyboards/input_club/ergodox_infinity/config.h index 3757ca3d605..f9cd4066379 100644 --- a/keyboards/input_club/ergodox_infinity/config.h +++ b/keyboards/input_club/ergodox_infinity/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . #define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND #define LED_MATRIX_LED_COUNT 76 #define LED_MATRIX_SPLIT { 38, 38 } -#define LED_DISABLE_WHEN_USB_SUSPENDED +#define LED_MATRIX_SLEEP // LED Matrix Animation modes. Explicitly enabled // For full list of effects, see: diff --git a/keyboards/input_club/whitefox/config.h b/keyboards/input_club/whitefox/config.h index 2d6affe84ab..2b22fb98527 100644 --- a/keyboards/input_club/whitefox/config.h +++ b/keyboards/input_club/whitefox/config.h @@ -23,7 +23,7 @@ along with this program. If not, see . /* LED matrix driver */ #define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND #define LED_MATRIX_LED_COUNT 71 -#define LED_DISABLE_WHEN_USB_SUSPENDED +#define LED_MATRIX_SLEEP /* i2c (for LED matrix) */ #define I2C1_CLOCK_SPEED 400000 diff --git a/keyboards/keychron/c1_pro/ansi/white/config.h b/keyboards/keychron/c1_pro/ansi/white/config.h index a8a836c5dd1..a2122b3d8e2 100644 --- a/keyboards/keychron/c1_pro/ansi/white/config.h +++ b/keyboards/keychron/c1_pro/ansi/white/config.h @@ -31,7 +31,7 @@ { 0x9D, 0x9D, 0x44, 0x9D, 0x9D, 0x44, 0x9D, 0x9D, 0x44, 0x9D, 0x9D, 0x44 } /* turn off effects when suspended */ -#define LED_DISABLE_WHEN_USB_SUSPENDED +#define LED_MATRIX_SLEEP /* Enbale caps_lcok, win os and mac os indicator */ #define CAPS_LOCK_LED_INDEX 63 diff --git a/keyboards/keychron/c2_pro/ansi/white/config.h b/keyboards/keychron/c2_pro/ansi/white/config.h index 26c812ffeff..531aeea0ec4 100644 --- a/keyboards/keychron/c2_pro/ansi/white/config.h +++ b/keyboards/keychron/c2_pro/ansi/white/config.h @@ -33,7 +33,7 @@ #define WIN_LED_INDEX 19 /* turn off effects when suspended */ -#define LED_DISABLE_WHEN_USB_SUSPENDED +#define LED_MATRIX_SLEEP // LED Matrix Animation modes. Explicitly enabled // For full list of effects, see: diff --git a/keyboards/keychron/s1/ansi/white/config.h b/keyboards/keychron/s1/ansi/white/config.h index fbe02caeb13..80ef3990471 100644 --- a/keyboards/keychron/s1/ansi/white/config.h +++ b/keyboards/keychron/s1/ansi/white/config.h @@ -27,7 +27,7 @@ // { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 } // 127mA /* Disable LED lighting when PC is in suspend */ -#define LED_DISABLE_WHEN_USB_SUSPENDED +#define LED_MATRIX_SLEEP /* Enable caps-lock LED */ #define CAPS_LOCK_LED_INDEX 46 diff --git a/keyboards/terrazzo/config.h b/keyboards/terrazzo/config.h index d2e76f1de09..d9ef8f0f9d3 100644 --- a/keyboards/terrazzo/config.h +++ b/keyboards/terrazzo/config.h @@ -22,7 +22,7 @@ #define LED_MATRIX_ROWS 15 #define LED_MATRIX_COLS 7 #define LED_MATRIX_MAXIMUM_BRIGHTNESS 20 -#define LED_DISABLE_WHEN_USB_SUSPENDED +#define LED_MATRIX_SLEEP // LED Matrix Animation modes. Explicitly enabled // For full list of effects, see: diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index eee43d92815..760a8b7484c 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c @@ -434,7 +434,7 @@ void led_matrix_init(void) { } void led_matrix_set_suspend_state(bool state) { -#ifdef LED_DISABLE_WHEN_USB_SUSPENDED +#ifdef LED_MATRIX_SLEEP if (state && !suspend_state && is_keyboard_master()) { // only run if turning off, and only once led_task_render(0); // turn off all LEDs when suspending led_task_flush(0); // and actually flash led state to LEDs