From bf2670601d29551896bab6811b9bb64de2d0ee0e Mon Sep 17 00:00:00 2001 From: skullY Date: Sat, 26 Jan 2019 14:33:55 -0800 Subject: compiles, but long delay on startup and problems --- quantum/led_matrix.c | 20 ++++++++++-------- quantum/led_matrix.h | 30 +++++++++----------------- quantum/led_matrix_drivers.c | 50 ++++++++++++++++++++++---------------------- quantum/quantum.c | 16 ++++++++++---- quantum/quantum.h | 6 +++++- 5 files changed, 63 insertions(+), 59 deletions(-) (limited to 'quantum') diff --git a/quantum/led_matrix.c b/quantum/led_matrix.c index 9a0aa6acd..3b284990d 100644 --- a/quantum/led_matrix.c +++ b/quantum/led_matrix.c @@ -59,7 +59,7 @@ bool g_suspend_state = false; uint32_t g_tick = 0; // Ticks since this key was last hit. -uint8_t g_key_hit[DRIVER_LED_TOTAL]; +uint8_t g_key_hit[LED_DRIVER_LED_COUNT]; // Ticks since any key was last hit. uint32_t g_any_key_hit = 0; @@ -95,7 +95,7 @@ void map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i, uint8_t led_matrix led; *led_count = 0; - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < LED_DRIVER_LED_COUNT; i++) { // map_index_to_led(i, &led); led = g_leds[i]; if (row == led.matrix_co.row && column == led.matrix_co.col) { @@ -187,7 +187,7 @@ void led_matrix_task(void) { g_any_key_hit++; } - for (int led = 0; led < DRIVER_LED_TOTAL; led++) { + for (int led = 0; led < LED_DRIVER_LED_COUNT; led++) { if (g_key_hit[led] < 255) { if (g_key_hit[led] == 254) g_last_led_count = MAX(g_last_led_count - 1, 0); @@ -271,7 +271,7 @@ void led_matrix_init(void) { // TODO: put the 1 second startup delay here? // clear the key hits - for (int led=0; led BACKLIGHT_LEVELS) diff --git a/quantum/quantum.h b/quantum/quantum.h index 56a6a1a99..169883609 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -28,7 +28,11 @@ #include "matrix.h" #include "keymap.h" #ifdef BACKLIGHT_ENABLE - #include "backlight.h" + #ifdef LED_MATRIX_ENABLE + #include "led_matrix.h" + #else + #include "backlight.h" + #endif #endif #ifdef RGBLIGHT_ENABLE #include "rgblight.h" -- cgit v1.2.3-24-g4f1b