From 36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 23 Sep 2022 22:46:23 +1000 Subject: Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399) --- keyboards/system76/launch_1/config.h | 2 +- keyboards/system76/launch_1/rgb_matrix_kb.inc | 12 ++++++------ keyboards/system76/system76_ec.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'keyboards/system76') diff --git a/keyboards/system76/launch_1/config.h b/keyboards/system76/launch_1/config.h index 50a6e6f9d7..6f257e9118 100644 --- a/keyboards/system76/launch_1/config.h +++ b/keyboards/system76/launch_1/config.h @@ -43,7 +43,7 @@ #ifdef RGB_MATRIX_ENABLE # define RGB_DI_PIN E2 -# define DRIVER_LED_TOTAL 84 +# define RGB_MATRIX_LED_COUNT 84 # define RGB_MATRIX_KEYPRESSES // Reacts to keypresses // # define RGB_MATRIX_KEYRELEASES // Reacts to keyreleases (instead of keypresses) // # define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enables framebuffer effects diff --git a/keyboards/system76/launch_1/rgb_matrix_kb.inc b/keyboards/system76/launch_1/rgb_matrix_kb.inc index 484483e0a1..02de10ed50 100644 --- a/keyboards/system76/launch_1/rgb_matrix_kb.inc +++ b/keyboards/system76/launch_1/rgb_matrix_kb.inc @@ -24,13 +24,13 @@ RGB_MATRIX_EFFECT(unlocked) #include "dynamic_keymap.h" static bool active_keys_initialized = false; -static uint8_t active_keys_table[DRIVER_LED_TOTAL] = {0}; +static uint8_t active_keys_table[RGB_MATRIX_LED_COUNT] = {0}; static void active_keys_initialize(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { uint8_t led = g_led_config.matrix_co[row][col]; - if (led < DRIVER_LED_TOTAL && row < 16 && col < 16) { + if (led < RGB_MATRIX_LED_COUNT && row < 16 && col < 16) { active_keys_table[led] = (row << 4) | col; } } @@ -65,10 +65,10 @@ static bool active_keys(effect_params_t* params) { } } - return led_max < DRIVER_LED_TOTAL; + return led_max < RGB_MATRIX_LED_COUNT; } -RGB raw_rgb_data[DRIVER_LED_TOTAL] = {0}; +RGB raw_rgb_data[RGB_MATRIX_LED_COUNT] = {0}; static uint8_t normalize_component(uint8_t component) { uint16_t x = (uint16_t)component; @@ -94,7 +94,7 @@ static bool raw_rgb(effect_params_t* params) { RGB rgb = normalize_index(i); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } - return led_max < DRIVER_LED_TOTAL; + return led_max < RGB_MATRIX_LED_COUNT; } static uint8_t unlocked_keys[8][2] = { @@ -151,7 +151,7 @@ static bool unlocked(effect_params_t* params) { RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } - return led_max < DRIVER_LED_TOTAL; + return led_max < RGB_MATRIX_LED_COUNT; } #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/keyboards/system76/system76_ec.c b/keyboards/system76/system76_ec.c index f6c8af82fe..5474181eca 100644 --- a/keyboards/system76/system76_ec.c +++ b/keyboards/system76/system76_ec.c @@ -129,7 +129,7 @@ static enum rgb_matrix_effects mode_map[] = { _Static_assert(sizeof(mode_map) == MODE_LAST, "mode_map_length"); -RGB raw_rgb_data[DRIVER_LED_TOTAL]; +RGB raw_rgb_data[RGB_MATRIX_LED_COUNT]; // clang-format off rgb_config_t layer_rgb[DYNAMIC_KEYMAP_LAYER_COUNT] = { @@ -294,7 +294,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { case CMD_LED_GET_COLOR: if (!bootloader_unlocked) { uint8_t index = data[2]; - if (index < DRIVER_LED_TOTAL) { + if (index < RGB_MATRIX_LED_COUNT) { data[3] = raw_rgb_data[index].r; data[4] = raw_rgb_data[index].g; data[5] = raw_rgb_data[index].b; @@ -322,7 +322,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { .b = data[5], }; - if (index < DRIVER_LED_TOTAL) { + if (index < RGB_MATRIX_LED_COUNT) { raw_rgb_data[index] = rgb; data[1] = 0; } else { -- cgit v1.2.3 From ea2819b2c2f1fbb9bf85010602758166530939ce Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 26 Sep 2022 14:40:15 +1000 Subject: Change `{LED,RGB}_DISABLE_TIMEOUT` to `{LED,RGB}_MATRIX_TIMEOUT` (#18415) --- keyboards/system76/launch_1/config.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'keyboards/system76') diff --git a/keyboards/system76/launch_1/config.h b/keyboards/system76/launch_1/config.h index 6f257e9118..739a3c78f8 100644 --- a/keyboards/system76/launch_1/config.h +++ b/keyboards/system76/launch_1/config.h @@ -47,8 +47,6 @@ # define RGB_MATRIX_KEYPRESSES // Reacts to keypresses // # define RGB_MATRIX_KEYRELEASES // Reacts to keyreleases (instead of keypresses) // # define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enables framebuffer effects -# define RGB_DISABLE_TIMEOUT 0 // Number of milliseconds to wait until RGB automatically turns off -# define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: Number of ticks to wait until disabling effects # define RGB_DISABLE_WHEN_USB_SUSPENDED // Turns off effects when suspended // Limit brightness to support USB-A at 0.5 A // TODO: Do this dynamically based on power source -- cgit v1.2.3 From e12ca14af8fc1799357bbfffd156d53b4a51001c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 27 Nov 2022 04:18:24 +1100 Subject: Change `RGB_MATRIX_STARTUP_*` defines to `RGB_MATRIX_DEFAULT_*` (#19079) --- keyboards/system76/launch_1/config.h | 10 +++++----- keyboards/system76/system76_ec.c | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'keyboards/system76') diff --git a/keyboards/system76/launch_1/config.h b/keyboards/system76/launch_1/config.h index 739a3c78f8..0431b9ab17 100644 --- a/keyboards/system76/launch_1/config.h +++ b/keyboards/system76/launch_1/config.h @@ -51,11 +51,11 @@ // Limit brightness to support USB-A at 0.5 A // TODO: Do this dynamically based on power source # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 176 // Limits maximum brightness of LEDs to 176 out of 255. If not defined, maximum brightness is set to 255 -# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Sets the default mode, if none has been set -# define RGB_MATRIX_STARTUP_HUE 142 // Sets the default hue value, if none has been set -# define RGB_MATRIX_STARTUP_SAT 255 // Sets the default saturation value, if none has been set -# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set -# define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Sets the default mode, if none has been set +# define RGB_MATRIX_DEFAULT_HUE 142 // Sets the default hue value, if none has been set +# define RGB_MATRIX_DEFAULT_SAT 255 // Sets the default saturation value, if none has been set +# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set +# define RGB_MATRIX_DEFAULT_SPD 127 // Sets the default animation speed, if none has been set # define RGB_MATRIX_DISABLE_KEYCODES // Disables control of rgb matrix by keycodes (must use code functions to control the feature) # define ENABLE_RGB_MATRIX_CYCLE_ALL diff --git a/keyboards/system76/system76_ec.c b/keyboards/system76/system76_ec.c index 5474181eca..6301659072 100644 --- a/keyboards/system76/system76_ec.c +++ b/keyboards/system76/system76_ec.c @@ -136,13 +136,13 @@ rgb_config_t layer_rgb[DYNAMIC_KEYMAP_LAYER_COUNT] = { // Layer 0 { .enable = 1, - .mode = RGB_MATRIX_STARTUP_MODE, + .mode = RGB_MATRIX_DEFAULT_MODE, .hsv = { - .h = RGB_MATRIX_STARTUP_HUE, - .s = RGB_MATRIX_STARTUP_SAT, - .v = RGB_MATRIX_STARTUP_VAL, + .h = RGB_MATRIX_DEFAULT_HUE, + .s = RGB_MATRIX_DEFAULT_SAT, + .v = RGB_MATRIX_DEFAULT_VAL, }, - .speed = RGB_MATRIX_STARTUP_SPD, + .speed = RGB_MATRIX_DEFAULT_SPD, .flags = LED_FLAG_KEYLIGHT, }, // Layer 1 @@ -150,11 +150,11 @@ rgb_config_t layer_rgb[DYNAMIC_KEYMAP_LAYER_COUNT] = { .enable = 1, .mode = RGB_MATRIX_CUSTOM_active_keys, .hsv = { - .h = RGB_MATRIX_STARTUP_HUE, - .s = RGB_MATRIX_STARTUP_SAT, - .v = RGB_MATRIX_STARTUP_VAL, + .h = RGB_MATRIX_DEFAULT_HUE, + .s = RGB_MATRIX_DEFAULT_SAT, + .v = RGB_MATRIX_DEFAULT_VAL, }, - .speed = RGB_MATRIX_STARTUP_SPD, + .speed = RGB_MATRIX_DEFAULT_SPD, .flags = LED_FLAG_KEYLIGHT, }, // Layer 2 @@ -162,11 +162,11 @@ rgb_config_t layer_rgb[DYNAMIC_KEYMAP_LAYER_COUNT] = { .enable = 1, .mode = RGB_MATRIX_CUSTOM_active_keys, .hsv = { - .h = RGB_MATRIX_STARTUP_HUE, - .s = RGB_MATRIX_STARTUP_SAT, - .v = RGB_MATRIX_STARTUP_VAL, + .h = RGB_MATRIX_DEFAULT_HUE, + .s = RGB_MATRIX_DEFAULT_SAT, + .v = RGB_MATRIX_DEFAULT_VAL, }, - .speed = RGB_MATRIX_STARTUP_SPD, + .speed = RGB_MATRIX_DEFAULT_SPD, .flags = LED_FLAG_KEYLIGHT, }, // Layer 3 @@ -174,11 +174,11 @@ rgb_config_t layer_rgb[DYNAMIC_KEYMAP_LAYER_COUNT] = { .enable = 1, .mode = RGB_MATRIX_CUSTOM_active_keys, .hsv = { - .h = RGB_MATRIX_STARTUP_HUE, - .s = RGB_MATRIX_STARTUP_SAT, - .v = RGB_MATRIX_STARTUP_VAL, + .h = RGB_MATRIX_DEFAULT_HUE, + .s = RGB_MATRIX_DEFAULT_SAT, + .v = RGB_MATRIX_DEFAULT_VAL, }, - .speed = RGB_MATRIX_STARTUP_SPD, + .speed = RGB_MATRIX_DEFAULT_SPD, .flags = LED_FLAG_KEYLIGHT, }, }; -- cgit v1.2.3