aboutsummaryrefslogtreecommitdiff
path: root/quantum/led_matrix.c
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2019-01-26 14:33:55 -0800
committerskullydazed <skullydazed@users.noreply.github.com>2019-02-10 15:37:12 -0800
commitbf2670601d29551896bab6811b9bb64de2d0ee0e (patch)
tree459467a986f6ce0fa3ef2accbfd0d43a3afffad8 /quantum/led_matrix.c
parent159191a8747891920aea7de2324507daa8a661fb (diff)
downloadqmk_firmware-bf2670601d29551896bab6811b9bb64de2d0ee0e.tar.gz
qmk_firmware-bf2670601d29551896bab6811b9bb64de2d0ee0e.zip
compiles, but long delay on startup and problems
Diffstat (limited to 'quantum/led_matrix.c')
-rw-r--r--quantum/led_matrix.c20
1 files changed, 11 insertions, 9 deletions
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;
59uint32_t g_tick = 0; 59uint32_t g_tick = 0;
60 60
61// Ticks since this key was last hit. 61// Ticks since this key was last hit.
62uint8_t g_key_hit[DRIVER_LED_TOTAL]; 62uint8_t g_key_hit[LED_DRIVER_LED_COUNT];
63 63
64// Ticks since any key was last hit. 64// Ticks since any key was last hit.
65uint32_t g_any_key_hit = 0; 65uint32_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
95 led_matrix led; 95 led_matrix led;
96 *led_count = 0; 96 *led_count = 0;
97 97
98 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { 98 for (uint8_t i = 0; i < LED_DRIVER_LED_COUNT; i++) {
99 // map_index_to_led(i, &led); 99 // map_index_to_led(i, &led);
100 led = g_leds[i]; 100 led = g_leds[i];
101 if (row == led.matrix_co.row && column == led.matrix_co.col) { 101 if (row == led.matrix_co.row && column == led.matrix_co.col) {
@@ -187,7 +187,7 @@ void led_matrix_task(void) {
187 g_any_key_hit++; 187 g_any_key_hit++;
188 } 188 }
189 189
190 for (int led = 0; led < DRIVER_LED_TOTAL; led++) { 190 for (int led = 0; led < LED_DRIVER_LED_COUNT; led++) {
191 if (g_key_hit[led] < 255) { 191 if (g_key_hit[led] < 255) {
192 if (g_key_hit[led] == 254) 192 if (g_key_hit[led] == 254)
193 g_last_led_count = MAX(g_last_led_count - 1, 0); 193 g_last_led_count = MAX(g_last_led_count - 1, 0);
@@ -271,7 +271,7 @@ void led_matrix_init(void) {
271 // TODO: put the 1 second startup delay here? 271 // TODO: put the 1 second startup delay here?
272 272
273 // clear the key hits 273 // clear the key hits
274 for (int led=0; led<DRIVER_LED_TOTAL; led++) { 274 for (int led=0; led<LED_DRIVER_LED_COUNT; led++) {
275 g_key_hit[led] = 255; 275 g_key_hit[led] = 255;
276 } 276 }
277 277
@@ -317,7 +317,7 @@ static uint8_t decrement(uint8_t value, uint8_t step, uint8_t min, uint8_t max)
317// uint8_t led[8], led_count; 317// uint8_t led[8], led_count;
318// map_row_column_to_led(row,column,led,&led_count); 318// map_row_column_to_led(row,column,led,&led_count);
319// for(uint8_t i = 0; i < led_count; i++) { 319// for(uint8_t i = 0; i < led_count; i++) {
320// if (led[i] < DRIVER_LED_TOTAL) { 320// if (led[i] < LED_DRIVER_LED_COUNT) {
321// void *address = backlight_get_custom_key_value_eeprom_address(led[i]); 321// void *address = backlight_get_custom_key_value_eeprom_address(led[i]);
322// eeprom_update_byte(address, value); 322// eeprom_update_byte(address, value);
323// } 323// }
@@ -396,9 +396,11 @@ uint8_t led_matrix_get_mode(void) {
396 return led_matrix_config.mode; 396 return led_matrix_config.mode;
397} 397}
398 398
399void led_matrix_set_value(uint8_t val, bool eeprom_write) { 399void led_matrix_set_value_noeeprom(uint8_t val) {
400 led_matrix_config.val = val; 400 led_matrix_config.val = val;
401 if (eeprom_write) { 401}
402 eeconfig_update_led_matrix(led_matrix_config.raw); 402
403 } 403void led_matrix_set_value(uint8_t val) {
404 led_matrix_set_value_noeeprom(val);
405 eeconfig_update_led_matrix(led_matrix_config.raw);
404} 406}