aboutsummaryrefslogtreecommitdiff
path: root/keyboards/terrazzo/terrazzo.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/terrazzo/terrazzo.c')
-rw-r--r--keyboards/terrazzo/terrazzo.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/keyboards/terrazzo/terrazzo.c b/keyboards/terrazzo/terrazzo.c
index f079ded4d..e6ba1f6c3 100644
--- a/keyboards/terrazzo/terrazzo.c
+++ b/keyboards/terrazzo/terrazzo.c
@@ -17,7 +17,6 @@
17#include "terrazzo.h" 17#include "terrazzo.h"
18 18
19#ifdef LED_MATRIX_ENABLE 19#ifdef LED_MATRIX_ENABLE
20 #include "is31fl3731-simple.h"
21 #include <math.h> 20 #include <math.h>
22 #include "print.h" 21 #include "print.h"
23 #include "quantum.h" 22 #include "quantum.h"
@@ -44,6 +43,39 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
44 {0, C2_15},{0, C2_14},{0, C2_13},{0, C2_12},{0, C2_11},{0, C2_10},{0, C2_9} 43 {0, C2_15},{0, C2_14},{0, C2_13},{0, C2_12},{0, C2_11},{0, C2_10},{0, C2_9}
45}; 44};
46 45
46led_config_t g_led_config = {
47 {
48 // Key Matrix to LED Index
49 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
50 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
51 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
52 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
53 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
54 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
55 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
56 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
57 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }
58 }, {
59 // LED Index to Physical Position
60 { 0, 0 }, { 16, 0 }, { 32, 0 }, { 48, 0 }, { 64, 0 }, { 80, 0 }, { 96, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 224, 0 },
61 { 0, 11 }, { 16, 11 }, { 32, 11 }, { 48, 11 }, { 64, 11 }, { 80, 11 }, { 96, 11 }, { 112, 11 }, { 128, 11 }, { 144, 11 }, { 160, 11 }, { 176, 11 }, { 192, 11 }, { 208, 11 }, { 224, 11 },
62 { 0, 21 }, { 16, 21 }, { 32, 21 }, { 48, 21 }, { 64, 21 }, { 80, 21 }, { 96, 21 }, { 112, 21 }, { 128, 21 }, { 144, 21 }, { 160, 21 }, { 176, 21 }, { 192, 21 }, { 208, 21 }, { 224, 21 },
63 { 0, 32 }, { 16, 32 }, { 32, 32 }, { 48, 32 }, { 64, 32 }, { 80, 32 }, { 96, 32 }, { 112, 32 }, { 128, 32 }, { 144, 32 }, { 160, 32 }, { 176, 32 }, { 192, 32 }, { 208, 32 }, { 224, 32 },
64 { 0, 43 }, { 16, 43 }, { 32, 43 }, { 48, 43 }, { 64, 43 }, { 80, 43 }, { 96, 43 }, { 112, 43 }, { 128, 43 }, { 144, 43 }, { 160, 43 }, { 176, 43 }, { 192, 43 }, { 208, 43 }, { 224, 43 },
65 { 0, 53 }, { 16, 53 }, { 32, 53 }, { 48, 53 }, { 64, 53 }, { 80, 53 }, { 96, 53 }, { 112, 53 }, { 128, 53 }, { 144, 53 }, { 160, 53 }, { 176, 53 }, { 192, 53 }, { 208, 53 }, { 224, 53 },
66 { 0, 64 }, { 16, 64 }, { 32, 64 }, { 48, 64 }, { 64, 64 }, { 80, 64 }, { 96, 64 }, { 112, 64 }, { 128, 64 }, { 144, 64 }, { 160, 64 }, { 176, 64 }, { 192, 64 }, { 208, 64 }, { 224, 64 }
67 }, {
68 // LED Index to Flag
69 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
70 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
71 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
72 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
73 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
74 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
75 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
76 }
77};
78
47#define TERRAZZO_EFFECT(name) 79#define TERRAZZO_EFFECT(name)
48#define TERRAZZO_EFFECT_IMPLS 80#define TERRAZZO_EFFECT_IMPLS
49 81
@@ -59,7 +91,7 @@ uint8_t terrazzo_effect = 1;
59void terrazzo_set_pixel(uint8_t x, uint8_t y, uint8_t value) { 91void terrazzo_set_pixel(uint8_t x, uint8_t y, uint8_t value) {
60 uint8_t target = y * LED_MATRIX_COLS + x; 92 uint8_t target = y * LED_MATRIX_COLS + x;
61 if (target < DRIVER_LED_TOTAL && target >= 0) { 93 if (target < DRIVER_LED_TOTAL && target >= 0) {
62 led_matrix_set_index_value(y * LED_MATRIX_COLS + x, value); 94 led_matrix_set_value(y * LED_MATRIX_COLS + x, value);
63 } 95 }
64} 96}
65 97
@@ -113,7 +145,7 @@ void terrazzo_mode_off(void) {
113void terrazzo_render(void) { 145void terrazzo_render(void) {
114 switch(terrazzo_effect) { 146 switch(terrazzo_effect) {
115 case TERRAZZO_NONE: 147 case TERRAZZO_NONE:
116 led_matrix_set_index_value_all(0); 148 led_matrix_set_value_all(0);
117 break; 149 break;
118 #define TERRAZZO_EFFECT(name, ...) \ 150 #define TERRAZZO_EFFECT(name, ...) \
119 case TERRAZZO_EFFECT_##name: \ 151 case TERRAZZO_EFFECT_##name: \