summaryrefslogtreecommitdiffstats
path: root/keyboards/system76
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-09-23 22:46:23 +1000
committerGitHub <noreply@github.com>2022-09-23 22:46:23 +1000
commit36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 (patch)
tree4e75c5fc5cd31d9fdc904876906c0b409ee45d90 /keyboards/system76
parentd967de0df749f3be63403e07feda416ea09351d0 (diff)
Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399)
Diffstat (limited to 'keyboards/system76')
-rw-r--r--keyboards/system76/launch_1/config.h2
-rw-r--r--keyboards/system76/launch_1/rgb_matrix_kb.inc12
-rw-r--r--keyboards/system76/system76_ec.c6
3 files changed, 10 insertions, 10 deletions
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 {