aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c
index 802c5afce..f239bd582 100644
--- a/quantum/rgb_matrix.c
+++ b/quantum/rgb_matrix.c
@@ -31,6 +31,8 @@ const point_t k_rgb_matrix_center = {112, 32};
31const point_t k_rgb_matrix_center = RGB_MATRIX_CENTER; 31const point_t k_rgb_matrix_center = RGB_MATRIX_CENTER;
32#endif 32#endif
33 33
34__attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); }
35
34// Generic effect runners 36// Generic effect runners
35#include "rgb_matrix_runners/effect_runner_dx_dy_dist.h" 37#include "rgb_matrix_runners/effect_runner_dx_dy_dist.h"
36#include "rgb_matrix_runners/effect_runner_dx_dy.h" 38#include "rgb_matrix_runners/effect_runner_dx_dy.h"
@@ -401,6 +403,10 @@ void rgb_matrix_task(void) {
401 break; 403 break;
402 case RENDERING: 404 case RENDERING:
403 rgb_task_render(effect); 405 rgb_task_render(effect);
406 if (!suspend_backlight) {
407 rgb_matrix_indicators();
408 rgb_matrix_indicators_advanced(&rgb_effect_params);
409 }
404 break; 410 break;
405 case FLUSHING: 411 case FLUSHING:
406 rgb_task_flush(effect); 412 rgb_task_flush(effect);
@@ -409,10 +415,6 @@ void rgb_matrix_task(void) {
409 rgb_task_sync(); 415 rgb_task_sync();
410 break; 416 break;
411 } 417 }
412
413 if (!suspend_backlight) {
414 rgb_matrix_indicators();
415 }
416} 418}
417 419
418void rgb_matrix_indicators(void) { 420void rgb_matrix_indicators(void) {
@@ -424,6 +426,28 @@ __attribute__((weak)) void rgb_matrix_indicators_kb(void) {}
424 426
425__attribute__((weak)) void rgb_matrix_indicators_user(void) {} 427__attribute__((weak)) void rgb_matrix_indicators_user(void) {}
426 428
429void rgb_matrix_indicators_advanced(effect_params_t *params) {
430 /* special handling is needed for "params->iter", since it's already been incremented.
431 * Could move the invocations to rgb_task_render, but then it's missing a few checks
432 * and not sure which would be better. Otherwise, this should be called from
433 * rgb_task_render, right before the iter++ line.
434 */
435#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL
436 uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * (params->iter - 1);
437 uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT;
438 if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL;
439#else
440 uint8_t min = 0;
441 uint8_t max = DRIVER_LED_TOTAL;
442#endif
443 rgb_matrix_indicators_advanced_kb(min, max);
444 rgb_matrix_indicators_advanced_user(min, max);
445}
446
447__attribute__((weak)) void rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {}
448
449__attribute__((weak)) void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {}
450
427void rgb_matrix_init(void) { 451void rgb_matrix_init(void) {
428 rgb_matrix_driver.init(); 452 rgb_matrix_driver.init();
429 453