Skip to content

Commit

Permalink
[Core] RGB Matrix limit basic indicators to the last render (qmk#21169)
Browse files Browse the repository at this point in the history
Co-authored-by: Joel Challis <git@zvecr.com>
  • Loading branch information
2 people authored and csolje committed Oct 21, 2023
1 parent f1b2839 commit 5fc9874
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion quantum/led_matrix/led_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,10 @@ void led_matrix_task(void) {
case RENDERING:
led_task_render(effect);
if (effect) {
led_matrix_indicators();
// Only run the basic indicators in the last render iteration (default there are 5 iterations)
if (led_effect_params.iter == LED_MATRIX_LED_PROCESS_MAX_ITERATIONS) {
led_matrix_indicators();
}
led_matrix_indicators_advanced(&led_effect_params);
}
break;
Expand Down
3 changes: 2 additions & 1 deletion quantum/led_matrix/led_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
#endif

#ifndef LED_MATRIX_LED_PROCESS_LIMIT
# define LED_MATRIX_LED_PROCESS_LIMIT (LED_MATRIX_LED_COUNT + 4) / 5
# define LED_MATRIX_LED_PROCESS_LIMIT ((LED_MATRIX_LED_COUNT + 4) / 5)
#endif
#define LED_MATRIX_LED_PROCESS_MAX_ITERATIONS ((LED_MATRIX_LED_COUNT + LED_MATRIX_LED_PROCESS_LIMIT - 1) / LED_MATRIX_LED_PROCESS_LIMIT)

#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < LED_MATRIX_LED_COUNT
# if defined(LED_MATRIX_SPLIT)
Expand Down
5 changes: 4 additions & 1 deletion quantum/rgb_matrix/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,10 @@ void rgb_matrix_task(void) {
case RENDERING:
rgb_task_render(effect);
if (effect) {
rgb_matrix_indicators();
// Only run the basic indicators in the last render iteration (default there are 5 iterations)
if (rgb_effect_params.iter == RGB_MATRIX_LED_PROCESS_MAX_ITERATIONS) {
rgb_matrix_indicators();
}
rgb_matrix_indicators_advanced(&rgb_effect_params);
}
break;
Expand Down
3 changes: 2 additions & 1 deletion quantum/rgb_matrix/rgb_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
#endif

#ifndef RGB_MATRIX_LED_PROCESS_LIMIT
# define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5
# define RGB_MATRIX_LED_PROCESS_LIMIT ((RGB_MATRIX_LED_COUNT + 4) / 5)
#endif
#define RGB_MATRIX_LED_PROCESS_MAX_ITERATIONS ((RGB_MATRIX_LED_COUNT + RGB_MATRIX_LED_PROCESS_LIMIT - 1) / RGB_MATRIX_LED_PROCESS_LIMIT)

#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < RGB_MATRIX_LED_COUNT
# if defined(RGB_MATRIX_SPLIT)
Expand Down

0 comments on commit 5fc9874

Please sign in to comment.