]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/planck/ez/ez.c
[Keyboard] Fixup RGB Matrix functionality on Planck EZ (#6099)
[qmk_firmware.git] / keyboards / planck / ez / ez.c
index c3b7e26170cb309f039e41014368f40288b3dd9d..e739b90b8c9eaf7b5762e13e5224b46913045069 100644 (file)
@@ -15,6 +15,7 @@
  */
 #include "ez.h"
 
+#ifdef RGB_MATRIX_ENABLE
 const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
 /* Refer to IS31 manual for these locations
  *   driver
@@ -79,63 +80,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
 
 };
 
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
-
-    /*{row | col << 4}
-      |             {x=0..224, y=0..64}
-      |              |                 modifier
-      |              |                 | */
-    {{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},
-    {{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},
-    {{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},
-    {{6|(5<<4)},  {20.36*11,21.33*2}, 1},
-
-    {{3|(0<<4)},   {20.36*0, 21.33*3}, 1},
-    {{3|(1<<4)},   {20.36*1, 21.33*3}, 1},
-    {{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|(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},
-    {{3|(3<<4)},  {20.36*10,21.33*3}, 1},
-    {{3|(4<<4)},  {20.36*11,21.33*3}, 1}
-};
+led_config_t g_led_config = { {
+    {   0,   1,   2,   3,   4,   5 },
+    {  12,  13,  14,  15,  16,  17 },
+    {  24,  25,  26,  27,  28,  29 },
+    {  36,  37,  38,  45,  46, NO_LED },
+    {   6,   7,   8,   9,  10,  11 },
+    {  18,  19,  20,  21,  22,  23 },
+    {  30,  31,  32,  33,  34,  35 },
+    {  42,  43,  44,  39,  40,  41 }
+}, {
+    {   0,   0 }, {  20,   0 }, {  40,   0 }, {  61,   0 }, {  81,   0 }, { 101,   0 }, { 122,   0 }, { 142,   0 }, { 162,   0 }, { 183,   0 }, { 203,   0 }, { 223,   0 },
+    {   0,  21 }, {  20,  21 }, {  40,  21 }, {  61,  21 }, {  81,  21 }, { 101,  21 }, { 122,  21 }, { 142,  21 }, { 162,  21 }, { 183,  21 }, { 203,  21 }, { 223,  21 },
+    {   0,  42 }, {  20,  42 }, {  40,  42 }, {  61,  42 }, {  81,  42 }, { 101,  42 }, { 122,  42 }, { 142,  42 }, { 162,  42 }, { 183,  42 }, { 203,  42 }, { 223,  42 },
+    {   0,  63 }, {  20,  63 }, {  40,  63 }, {  61,  63 }, {  81,  63 }, { 111,  63 }, { 142,  63 }, { 162,  63 }, { 183,  63 }, { 203,  63 }, { 223,  63 }
+}, {
+    1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
+    1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
+    1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
+    1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1
+} };
+
+void suspend_power_down_kb(void) {
+    rgb_matrix_set_suspend_state(true);
+    suspend_power_down_user();
+}
+
+ void suspend_wakeup_init_kb(void) {
+    rgb_matrix_set_suspend_state(false);
+    suspend_wakeup_init_user();
+}
+#endif
 
 void matrix_init_kb(void) {
   matrix_init_user();