summaryrefslogtreecommitdiff
path: root/keyboards/terrazzo
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/terrazzo')
-rw-r--r--keyboards/terrazzo/config.h2
-rw-r--r--keyboards/terrazzo/terrazzo.c20
2 files changed, 13 insertions, 9 deletions
diff --git a/keyboards/terrazzo/config.h b/keyboards/terrazzo/config.h
index ec4ded7eb9..1d7224a09b 100644
--- a/keyboards/terrazzo/config.h
+++ b/keyboards/terrazzo/config.h
@@ -76,7 +76,7 @@ so there is only one configuration. */
#define LED_DRIVER_ADDR_1 0x74
#define LED_DRIVER_COUNT 1
-#define DRIVER_LED_TOTAL 105
+#define LED_MATRIX_LED_COUNT 105
#define LED_MATRIX_ROWS 15
#define LED_MATRIX_COLS 7
#define LED_MATRIX_MAXIMUM_BRIGHTNESS 20
diff --git a/keyboards/terrazzo/terrazzo.c b/keyboards/terrazzo/terrazzo.c
index 731efec20c..cc62225de7 100644
--- a/keyboards/terrazzo/terrazzo.c
+++ b/keyboards/terrazzo/terrazzo.c
@@ -21,7 +21,7 @@
#include "print.h"
#include "quantum.h"
-const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
+const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* https://cdn-learn.adafruit.com/downloads/pdf/adafruit-15x7-7x15-charlieplex-led-matrix-charliewing-featherwing.pdf
*/
@@ -90,7 +90,7 @@ uint8_t terrazzo_effect = 1;
void terrazzo_set_pixel(uint8_t x, uint8_t y, uint8_t value) {
uint8_t target = y * LED_MATRIX_COLS + x;
- if (target < DRIVER_LED_TOTAL && target >= 0) {
+ if (target < LED_MATRIX_LED_COUNT && target >= 0) {
led_matrix_set_value(y * LED_MATRIX_COLS + x, value);
}
}
@@ -115,12 +115,12 @@ void terrazzo_scroll_pixel(bool clockwise) {
terrazzo_led_index = terrazzo_led_index + 1;
} else {
terrazzo_led_index = terrazzo_led_index - 1;
- }
-
- if (terrazzo_led_index >= DRIVER_LED_TOTAL) {
+ }
+
+ if (terrazzo_led_index >= LED_MATRIX_LED_COUNT) {
terrazzo_led_index = 0;
} else if (terrazzo_led_index <= 0 ) {
- terrazzo_led_index = DRIVER_LED_TOTAL - 1;
+ terrazzo_led_index = LED_MATRIX_LED_COUNT - 1;
}
}
@@ -156,8 +156,12 @@ void terrazzo_render(void) {
}
}
-void led_matrix_indicators_kb(void) {
+bool led_matrix_indicators_kb(void) {
+ if (!led_matrix_indicators_user()) {
+ return false;
+ }
terrazzo_render();
+ return true;
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
@@ -194,4 +198,4 @@ void suspend_wakeup_init_kb(void) {
}
-#endif \ No newline at end of file
+#endif