summaryrefslogtreecommitdiff
path: root/keyboards/dztech/dz60rgb/keymaps
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-05-07 18:22:46 -0500
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-05-07 16:22:46 -0700
commitaf89752bffbaf5dcea30ea16be66b4d682701bc4 (patch)
treec82f2bc25409159a44778379db8b3a35afc47b8a /keyboards/dztech/dz60rgb/keymaps
parentc7f8548d9af2045996294602d2a4bd9a214ae23c (diff)
rgb_led struct conversion (aka: Per led (key) type rgb matrix effects - part 2) (#5783)
* Initial conversion of the rgb_led struct * Converting last keyboard & updating effects to take advantage of the new structure * New struct should not be const * Updated docs * Changing define ___ for no led to NO_LED * Missed converting some keymap usages of the old struct layout
Diffstat (limited to 'keyboards/dztech/dz60rgb/keymaps')
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/iso/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c30
5 files changed, 21 insertions, 29 deletions
diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c
index 741fc55fb9..584f035ef4 100644
--- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c
+++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c
@@ -38,11 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
+extern led_config_t g_led_config;
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
- rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
- led = g_rgb_leds[i];
- if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
+ if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) {
rgb_matrix_set_color( i, red, green, blue );
}
}
diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c
index 1f3807c3b7..5a7a56801a 100644
--- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c
+++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c
@@ -39,11 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
+extern led_config_t g_led_config;
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
- rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
- led = g_rgb_leds[i];
- if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
+ if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) {
rgb_matrix_set_color( i, red, green, blue );
}
}
diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c
index 4575eb19d5..34c1752ffa 100644
--- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c
+++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c
@@ -39,11 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS),
};
+extern led_config_t g_led_config;
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
- rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
- led = g_rgb_leds[i];
- if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
+ if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) {
rgb_matrix_set_color( i, red, green, blue );
}
}
diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c
index 5e38848035..3a90d2f335 100644
--- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c
+++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c
@@ -38,11 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
+extern led_config_t g_led_config;
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
- rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
- led = g_rgb_leds[i];
- if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
+ if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) {
rgb_matrix_set_color( i, red, green, blue );
}
}
diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c
index 3dfa783744..a6d1e226bd 100644
--- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c
+++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c
@@ -50,40 +50,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool default_layer)
-{
- rgb_led led;
-
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
- led = g_rgb_leds[i];
-
- if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
- rgb_matrix_set_color( i, red, green, blue );
- }
- }
+extern led_config_t g_led_config;
+void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
+ for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) {
+ rgb_matrix_set_color( i, red, green, blue );
+ }
+ }
}
void rgb_matrix_indicators_user(void)
{
uint8_t this_led = host_keyboard_leds();
-
+
if (!g_suspend_state) {
switch (biton32(layer_state)) {
case _LAYER1:
rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break;
-
+
case _LAYER2:
rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break;
-
+
case _LAYER4:
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break;
}
}
-
+
if (this_led & (1 << USB_LED_CAPS_LOCK)) {
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
}
-
+
switch (biton32(layer_state)) {
case _LAYER3:
if (this_led & (1 << USB_LED_NUM_LOCK)) {
@@ -91,7 +87,7 @@ void rgb_matrix_indicators_user(void)
} else {
rgb_matrix_set_color(13, 0x00, 0x00, 0x00);
}
-
+
rgb_matrix_set_color(0, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(1, 0x00, 0x00, 0x00);
rgb_matrix_set_color(1, 0x00, 0xFF, 0x00);