summaryrefslogtreecommitdiffstats
path: root/keyboards/planck
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/planck
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/planck')
-rw-r--r--keyboards/planck/ez/ez.c66
-rw-r--r--keyboards/planck/keymaps/tom/keymap.c4
-rw-r--r--keyboards/planck/light/light.c70
3 files changed, 70 insertions, 70 deletions
diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c
index c3b7e26170..94f5071896 100644
--- a/keyboards/planck/ez/ez.c
+++ b/keyboards/planck/ez/ez.c
@@ -79,49 +79,49 @@ 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] = {
/*{row | col << 4}
| {x=0..224, y=0..64}
- | | modifier
+ | | flags
| | | */
{{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
- {{0|(1<<4)}, {20.36*1, 21.33*0}, 0},
- {{0|(2<<4)}, {20.36*2, 21.33*0}, 0},
- {{0|(3<<4)}, {20.36*3, 21.33*0}, 0},
- {{0|(4<<4)}, {20.36*4, 21.33*0}, 0},
- {{0|(5<<4)}, {20.36*5, 21.33*0}, 0},
- {{4|(0<<4)}, {20.36*6, 21.33*0}, 0},
- {{4|(1<<4)}, {20.36*7, 21.33*0}, 0},
- {{4|(2<<4)}, {20.36*8, 21.33*0}, 0},
- {{4|(3<<4)}, {20.36*9, 21.33*0}, 0},
- {{4|(4<<4)}, {20.36*10,21.33*0}, 0},
+ {{0|(1<<4)}, {20.36*1, 21.33*0}, 4},
+ {{0|(2<<4)}, {20.36*2, 21.33*0}, 4},
+ {{0|(3<<4)}, {20.36*3, 21.33*0}, 4},
+ {{0|(4<<4)}, {20.36*4, 21.33*0}, 4},
+ {{0|(5<<4)}, {20.36*5, 21.33*0}, 4},
+ {{4|(0<<4)}, {20.36*6, 21.33*0}, 4},
+ {{4|(1<<4)}, {20.36*7, 21.33*0}, 4},
+ {{4|(2<<4)}, {20.36*8, 21.33*0}, 4},
+ {{4|(3<<4)}, {20.36*9, 21.33*0}, 4},
+ {{4|(4<<4)}, {20.36*10,21.33*0}, 4},
{{4|(5<<4)}, {20.36*11,21.33*0}, 1},
{{1|(0<<4)}, {20.36*0, 21.33*1}, 1},
- {{1|(1<<4)}, {20.36*1, 21.33*1}, 0},
- {{1|(2<<4)}, {20.36*2, 21.33*1}, 0},
- {{1|(3<<4)}, {20.36*3, 21.33*1}, 0},
- {{1|(4<<4)}, {20.36*4, 21.33*1}, 0},
- {{1|(5<<4)}, {20.36*5, 21.33*1}, 0},
- {{5|(0<<4)}, {20.36*6, 21.33*1}, 0},
- {{5|(1<<4)}, {20.36*7, 21.33*1}, 0},
- {{5|(2<<4)}, {20.36*8, 21.33*1}, 0},
- {{5|(3<<4)}, {20.36*9, 21.33*1}, 0},
- {{5|(4<<4)}, {20.36*10,21.33*1}, 0},
+ {{1|(1<<4)}, {20.36*1, 21.33*1}, 4},
+ {{1|(2<<4)}, {20.36*2, 21.33*1}, 4},
+ {{1|(3<<4)}, {20.36*3, 21.33*1}, 4},
+ {{1|(4<<4)}, {20.36*4, 21.33*1}, 4},
+ {{1|(5<<4)}, {20.36*5, 21.33*1}, 4},
+ {{5|(0<<4)}, {20.36*6, 21.33*1}, 4},
+ {{5|(1<<4)}, {20.36*7, 21.33*1}, 4},
+ {{5|(2<<4)}, {20.36*8, 21.33*1}, 4},
+ {{5|(3<<4)}, {20.36*9, 21.33*1}, 4},
+ {{5|(4<<4)}, {20.36*10,21.33*1}, 4},
{{5|(5<<4)}, {20.36*11,21.33*1}, 1},
{{2|(0<<4)}, {20.36*0, 21.33*2}, 1},
- {{2|(1<<4)}, {20.36*1, 21.33*2}, 0},
- {{2|(2<<4)}, {20.36*2, 21.33*2}, 0},
- {{2|(3<<4)}, {20.36*3, 21.33*2}, 0},
- {{2|(4<<4)}, {20.36*4, 21.33*2}, 0},
- {{2|(5<<4)}, {20.36*5, 21.33*2}, 0},
- {{6|(0<<4)}, {20.36*6, 21.33*2}, 0},
- {{6|(1<<4)}, {20.36*7, 21.33*2}, 0},
- {{6|(2<<4)}, {20.36*8, 21.33*2}, 0},
- {{6|(3<<4)}, {20.36*9, 21.33*2}, 0},
- {{6|(4<<4)}, {20.36*10,21.33*2}, 0},
+ {{2|(1<<4)}, {20.36*1, 21.33*2}, 4},
+ {{2|(2<<4)}, {20.36*2, 21.33*2}, 4},
+ {{2|(3<<4)}, {20.36*3, 21.33*2}, 4},
+ {{2|(4<<4)}, {20.36*4, 21.33*2}, 4},
+ {{2|(5<<4)}, {20.36*5, 21.33*2}, 4},
+ {{6|(0<<4)}, {20.36*6, 21.33*2}, 4},
+ {{6|(1<<4)}, {20.36*7, 21.33*2}, 4},
+ {{6|(2<<4)}, {20.36*8, 21.33*2}, 4},
+ {{6|(3<<4)}, {20.36*9, 21.33*2}, 4},
+ {{6|(4<<4)}, {20.36*10,21.33*2}, 4},
{{6|(5<<4)}, {20.36*11,21.33*2}, 1},
{{3|(0<<4)}, {20.36*0, 21.33*3}, 1},
@@ -129,7 +129,7 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{3|(2<<4)}, {20.36*2, 21.33*3}, 1},
{{7|(3<<4)}, {20.36*3, 21.33*3}, 1},
{{7|(4<<4)}, {20.36*4, 21.33*3}, 1},
- {{7|(5<<4)}, {20.36*5.5,21.33*3}, 0},
+ {{7|(5<<4)}, {20.36*5.5,21.33*3}, 4},
{{7|(0<<4)}, {20.36*7, 21.33*3}, 1},
{{7|(1<<4)}, {20.36*8, 21.33*3}, 1},
{{7|(2<<4)}, {20.36*9, 21.33*3}, 1},
diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c
index 6e3b08938f..5b7177c6c9 100644
--- a/keyboards/planck/keymaps/tom/keymap.c
+++ b/keyboards/planck/keymaps/tom/keymap.c
@@ -231,7 +231,7 @@ void rgb_matrix_indicators_user(void) {
case _RAISE:
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
- if ( led.modifier ) {
+ if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
rgb_matrix_set_color(i, 0x6B, 0x00, 0x80);
} else {
rgb_matrix_set_color(i, 0x00, 0xFF, 0x00);
@@ -242,7 +242,7 @@ void rgb_matrix_indicators_user(void) {
case _LOWER:
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
- if ( led.modifier ) {
+ if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00);
} else {
rgb_matrix_set_color(i, 0x00, 0x67, 0xC7);
diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c
index f463090dd0..178d28274c 100644
--- a/keyboards/planck/light/light.c
+++ b/keyboards/planck/light/light.c
@@ -77,49 +77,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{1, C9_14, C8_14, C7_14}
};
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
/*{row | col << 4}
| {x=0..224, y=0..64}
- | | modifier
+ | | flags
| | | */
{{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
- {{0|(1<<4)}, {20.36*1, 21.33*0}, 0},
- {{0|(2<<4)}, {20.36*2, 21.33*0}, 0},
- {{0|(3<<4)}, {20.36*3, 21.33*0}, 0},
- {{0|(4<<4)}, {20.36*4, 21.33*0}, 0},
- {{0|(5<<4)}, {20.36*5, 21.33*0}, 0},
- {{0|(6<<4)}, {20.36*6, 21.33*0}, 0},
- {{0|(7<<4)}, {20.36*7, 21.33*0}, 0},
- {{0|(8<<4)}, {20.36*8, 21.33*0}, 0},
- {{0|(9<<4)}, {20.36*9, 21.33*0}, 0},
- {{0|(10<<4)}, {20.36*10,21.33*0}, 0},
+ {{0|(1<<4)}, {20.36*1, 21.33*0}, 4},
+ {{0|(2<<4)}, {20.36*2, 21.33*0}, 4},
+ {{0|(3<<4)}, {20.36*3, 21.33*0}, 4},
+ {{0|(4<<4)}, {20.36*4, 21.33*0}, 4},
+ {{0|(5<<4)}, {20.36*5, 21.33*0}, 4},
+ {{0|(6<<4)}, {20.36*6, 21.33*0}, 4},
+ {{0|(7<<4)}, {20.36*7, 21.33*0}, 4},
+ {{0|(8<<4)}, {20.36*8, 21.33*0}, 4},
+ {{0|(9<<4)}, {20.36*9, 21.33*0}, 4},
+ {{0|(10<<4)}, {20.36*10,21.33*0}, 4},
{{0|(11<<4)}, {20.36*11,21.33*0}, 1},
{{1|(0<<4)}, {20.36*0, 21.33*1}, 1},
- {{1|(1<<4)}, {20.36*1, 21.33*1}, 0},
- {{1|(2<<4)}, {20.36*2, 21.33*1}, 0},
- {{1|(3<<4)}, {20.36*3, 21.33*1}, 0},
- {{1|(4<<4)}, {20.36*4, 21.33*1}, 0},
- {{1|(5<<4)}, {20.36*5, 21.33*1}, 0},
- {{1|(6<<4)}, {20.36*6, 21.33*1}, 0},
- {{1|(7<<4)}, {20.36*7, 21.33*1}, 0},
- {{1|(8<<4)}, {20.36*8, 21.33*1}, 0},
- {{1|(9<<4)}, {20.36*9, 21.33*1}, 0},
- {{1|(10<<4)}, {20.36*10,21.33*1}, 0},
+ {{1|(1<<4)}, {20.36*1, 21.33*1}, 4},
+ {{1|(2<<4)}, {20.36*2, 21.33*1}, 4},
+ {{1|(3<<4)}, {20.36*3, 21.33*1}, 4},
+ {{1|(4<<4)}, {20.36*4, 21.33*1}, 4},
+ {{1|(5<<4)}, {20.36*5, 21.33*1}, 4},
+ {{1|(6<<4)}, {20.36*6, 21.33*1}, 4},
+ {{1|(7<<4)}, {20.36*7, 21.33*1}, 4},
+ {{1|(8<<4)}, {20.36*8, 21.33*1}, 4},
+ {{1|(9<<4)}, {20.36*9, 21.33*1}, 4},
+ {{1|(10<<4)}, {20.36*10,21.33*1}, 4},
{{1|(11<<4)}, {20.36*11,21.33*1}, 1},
{{2|(0<<4)}, {20.36*0, 21.33*2}, 1},
- {{2|(1<<4)}, {20.36*1, 21.33*2}, 0},
- {{2|(2<<4)}, {20.36*2, 21.33*2}, 0},
- {{2|(3<<4)}, {20.36*3, 21.33*2}, 0},
- {{2|(4<<4)}, {20.36*4, 21.33*2}, 0},
- {{2|(5<<4)}, {20.36*5, 21.33*2}, 0},
- {{2|(6<<4)}, {20.36*6, 21.33*2}, 0},
- {{2|(7<<4)}, {20.36*7, 21.33*2}, 0},
- {{2|(8<<4)}, {20.36*8, 21.33*2}, 0},
- {{2|(9<<4)}, {20.36*9, 21.33*2}, 0},
- {{2|(10<<4)}, {20.36*10,21.33*2}, 0},
+ {{2|(1<<4)}, {20.36*1, 21.33*2}, 4},
+ {{2|(2<<4)}, {20.36*2, 21.33*2}, 4},
+ {{2|(3<<4)}, {20.36*3, 21.33*2}, 4},
+ {{2|(4<<4)}, {20.36*4, 21.33*2}, 4},
+ {{2|(5<<4)}, {20.36*5, 21.33*2}, 4},
+ {{2|(6<<4)}, {20.36*6, 21.33*2}, 4},
+ {{2|(7<<4)}, {20.36*7, 21.33*2}, 4},
+ {{2|(8<<4)}, {20.36*8, 21.33*2}, 4},
+ {{2|(9<<4)}, {20.36*9, 21.33*2}, 4},
+ {{2|(10<<4)}, {20.36*10,21.33*2}, 4},
{{2|(11<<4)}, {20.36*11,21.33*2}, 1},
{{3|(0<<4)}, {20.36*0, 21.33*3}, 1},
@@ -127,9 +127,9 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{3|(2<<4)}, {20.36*2, 21.33*3}, 1},
{{3|(3<<4)}, {20.36*3, 21.33*3}, 1},
{{3|(4<<4)}, {20.36*4, 21.33*3}, 1},
- {{3|(5<<4)}, {20.36*5, 21.33*3}, 0},
- {{3|(5<<4)}, {20.36*5.5,21.33*3}, 0},
- {{3|(6<<4)}, {20.36*6, 21.33*3}, 0},
+ {{3|(5<<4)}, {20.36*5, 21.33*3}, 4},
+ {{3|(5<<4)}, {20.36*5.5,21.33*3}, 4},
+ {{3|(6<<4)}, {20.36*6, 21.33*3}, 4},
{{3|(7<<4)}, {20.36*7, 21.33*3}, 1},
{{3|(8<<4)}, {20.36*8, 21.33*3}, 1},
{{3|(9<<4)}, {20.36*9, 21.33*3}, 1},