summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2023-07-03 08:56:48 +1000
committerGitHub <noreply@github.com>2023-07-02 15:56:48 -0700
commitc4f66e5d6e57d2100a8d3a08758075c470f04767 (patch)
treea2b5b145bae2ed51bfd50c0c912617dde9607ee5
parented6528b3e3f6f306b1ddd6155b0bad07d088898d (diff)
[Core] RGB Matrix limit basic indicators to the last render (#21169)
Co-authored-by: Joel Challis <git@zvecr.com>
-rw-r--r--quantum/led_matrix/led_matrix.c5
-rw-r--r--quantum/led_matrix/led_matrix.h3
-rw-r--r--quantum/rgb_matrix/rgb_matrix.c5
-rw-r--r--quantum/rgb_matrix/rgb_matrix.h3
4 files changed, 12 insertions, 4 deletions
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c
index 828d61641a..4b692d1904 100644
--- a/quantum/led_matrix/led_matrix.c
+++ b/quantum/led_matrix/led_matrix.c
@@ -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;
diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h
index c7d360f366..9091f6890b 100644
--- a/quantum/led_matrix/led_matrix.h
+++ b/quantum/led_matrix/led_matrix.h
@@ -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)
diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c
index 1f3912cf7e..1680389793 100644
--- a/quantum/rgb_matrix/rgb_matrix.c
+++ b/quantum/rgb_matrix/rgb_matrix.c
@@ -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;
diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h
index 9ea248b66d..83851d8995 100644
--- a/quantum/rgb_matrix/rgb_matrix.h
+++ b/quantum/rgb_matrix/rgb_matrix.h
@@ -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)