summaryrefslogtreecommitdiff
path: root/keyboards/dztech/dz40rgb
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-04-30 00:18:50 +0200
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-04-29 15:18:50 -0700
commita7113c8ed090d0ac647f30ee9b8ef41252e568ed (patch)
tree24d33db679b4d1357efef2784e69fea48e98d0ed /keyboards/dztech/dz40rgb
parent1d784f0f9575b70e35c9c8338b0ff80dc7316d7e (diff)
Updated rgb_led struct field modifier to flags (#5619)
Updated effects to test led flags Updated massdrop to use new flags field for led toggle
Diffstat (limited to 'keyboards/dztech/dz40rgb')
-rw-r--r--keyboards/dztech/dz40rgb/dz40rgb.c84
-rw-r--r--keyboards/dztech/dz40rgb/keymaps/default/keymap.c6
-rw-r--r--keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c6
3 files changed, 46 insertions, 50 deletions
diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c
index b1a03760f8..34bfc4366f 100644
--- a/keyboards/dztech/dz40rgb/dz40rgb.c
+++ b/keyboards/dztech/dz40rgb/dz40rgb.c
@@ -71,7 +71,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
};
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{0|(11<<4)}, {20.36*11, 0}, 1},
{{0|(10<<4)}, {20.36*10, 0}, 1},
@@ -90,32 +90,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{0|(13<<4)}, {20.36*0,21.33*0.5}, 1},
{{1|(11<<4)}, {20.36*11, 21.33}, 1},
- {{1|(10<<4)}, {20.36*10, 21.33}, 0},
- {{1|(9<<4)}, {20.36*9, 21.33}, 0},
- {{1|(8<<4)}, {20.36*8, 21.33}, 0},
- {{1|(7<<4)}, {20.36*7, 21.33}, 0},
- {{1|(6<<4)}, { 20.36*6, 21.33}, 0},
- {{1|(5<<4)}, { 20.36*5, 21.33}, 0},
- {{1|(4<<4)}, { 20.36*4, 21.33}, 0},
- {{1|(3<<4)}, { 20.36*3, 21.33}, 0},
- {{1|(2<<4)}, { 20.36*2, 21.33}, 0},
- {{1|(1<<4)}, { 20.36*1, 21.33}, 0},
+ {{1|(10<<4)}, {20.36*10, 21.33}, 4},
+ {{1|(9<<4)}, {20.36*9, 21.33}, 4},
+ {{1|(8<<4)}, {20.36*8, 21.33}, 4},
+ {{1|(7<<4)}, {20.36*7, 21.33}, 4},
+ {{1|(6<<4)}, { 20.36*6, 21.33}, 4},
+ {{1|(5<<4)}, { 20.36*5, 21.33}, 4},
+ {{1|(4<<4)}, { 20.36*4, 21.33}, 4},
+ {{1|(3<<4)}, { 20.36*3, 21.33}, 4},
+ {{1|(2<<4)}, { 20.36*2, 21.33}, 4},
+ {{1|(1<<4)}, { 20.36*1, 21.33}, 4},
{{1|(0<<4)}, { 20.36*0, 21.33}, 1},
{{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1},
{{1|(13<<4)}, {20.36*0,21.33*1.5}, 1},
{{2|(11<<4)}, {20.36*11, 21.33*2}, 1},
- {{2|(10<<4)}, {20.36*10, 21.33*2}, 0},
- {{2|(9<<4)}, {20.36*9, 21.33*2}, 0},
- {{2|(8<<4)}, {20.36*8, 21.33*2}, 0},
- {{2|(7<<4)}, {20.36*7, 21.33*2}, 0},
- {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0},
- {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0},
- {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0},
- {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0},
- {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0},
- {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0},
+ {{2|(10<<4)}, {20.36*10, 21.33*2}, 4},
+ {{2|(9<<4)}, {20.36*9, 21.33*2}, 4},
+ {{2|(8<<4)}, {20.36*8, 21.33*2}, 4},
+ {{2|(7<<4)}, {20.36*7, 21.33*2}, 4},
+ {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4},
+ {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4},
+ {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4},
+ {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4},
+ {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4},
+ {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4},
{{2|(0<<4)}, { 20.36*0, 21.33*2}, 1},
{{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1},
@@ -205,7 +205,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
};
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{0|(11<<4)}, {20.36*11, 0}, 1},
{{0|(10<<4)}, {20.36*10, 0}, 1},
@@ -224,32 +224,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{0|(13<<4)}, {20.36*0,21.33*0.5}, 1},
{{1|(11<<4)}, {20.36*11, 21.33}, 1},
- {{1|(10<<4)}, {20.36*10, 21.33}, 0},
- {{1|(9<<4)}, {20.36*9, 21.33}, 0},
- {{1|(8<<4)}, {20.36*8, 21.33}, 0},
- {{1|(7<<4)}, {20.36*7, 21.33}, 0},
- {{1|(6<<4)}, { 20.36*6, 21.33}, 0},
- {{1|(5<<4)}, { 20.36*5, 21.33}, 0},
- {{1|(4<<4)}, { 20.36*4, 21.33}, 0},
- {{1|(3<<4)}, { 20.36*3, 21.33}, 0},
- {{1|(2<<4)}, { 20.36*2, 21.33}, 0},
- {{1|(1<<4)}, { 20.36*1, 21.33}, 0},
+ {{1|(10<<4)}, {20.36*10, 21.33}, 4},
+ {{1|(9<<4)}, {20.36*9, 21.33}, 4},
+ {{1|(8<<4)}, {20.36*8, 21.33}, 4},
+ {{1|(7<<4)}, {20.36*7, 21.33}, 4},
+ {{1|(6<<4)}, { 20.36*6, 21.33}, 4},
+ {{1|(5<<4)}, { 20.36*5, 21.33}, 4},
+ {{1|(4<<4)}, { 20.36*4, 21.33}, 4},
+ {{1|(3<<4)}, { 20.36*3, 21.33}, 4},
+ {{1|(2<<4)}, { 20.36*2, 21.33}, 4},
+ {{1|(1<<4)}, { 20.36*1, 21.33}, 4},
{{1|(0<<4)}, { 20.36*0, 21.33}, 1},
{{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1},
{{1|(13<<4)}, {20.36*0,21.33*1.5}, 1},
{{2|(11<<4)}, {20.36*11, 21.33*2}, 1},
- {{2|(10<<4)}, {20.36*10, 21.33*2}, 0},
- {{2|(9<<4)}, {20.36*9, 21.33*2}, 0},
- {{2|(8<<4)}, {20.36*8, 21.33*2}, 0},
- {{2|(7<<4)}, {20.36*7, 21.33*2}, 0},
- {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0},
- {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0},
- {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0},
- {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0},
- {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0},
- {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0},
+ {{2|(10<<4)}, {20.36*10, 21.33*2}, 4},
+ {{2|(9<<4)}, {20.36*9, 21.33*2}, 4},
+ {{2|(8<<4)}, {20.36*8, 21.33*2}, 4},
+ {{2|(7<<4)}, {20.36*7, 21.33*2}, 4},
+ {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4},
+ {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4},
+ {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4},
+ {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4},
+ {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4},
+ {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4},
{{2|(0<<4)}, { 20.36*0, 21.33*2}, 1},
{{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1},
diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c
index 6ea7421c92..59b917121c 100644
--- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c
+++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c
@@ -35,10 +35,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def
rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
- if (led.matrix_co.raw < 0xFF) {
- if (led.modifier) {
- rgb_matrix_set_color( i, red, green, blue );
- }
+ if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
+ rgb_matrix_set_color( i, red, green, blue );
}
}
}
diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c
index bbbe5a8f0c..5613e35000 100644
--- a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c
+++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c
@@ -58,10 +58,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def
rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
- if (led.matrix_co.raw < 0xFF) {
- if (led.modifier) {
- rgb_matrix_set_color( i, red, green, blue );
- }
+ if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
+ rgb_matrix_set_color( i, red, green, blue );
}
}
}