aboutsummaryrefslogtreecommitdiff
path: root/quantum/led_matrix/led_matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/led_matrix/led_matrix.c')
-rw-r--r--quantum/led_matrix/led_matrix.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c
index 58263c62e3..7a0e8a5ebb 100644
--- a/quantum/led_matrix/led_matrix.c
+++ b/quantum/led_matrix/led_matrix.c
@@ -19,7 +19,6 @@
#include "led_matrix.h"
#include "progmem.h"
-#include "eeprom.h"
#include "eeconfig.h"
#include "keyboard.h"
#include "sync_timer.h"
@@ -46,6 +45,9 @@ const led_point_t k_led_matrix_center = LED_MATRIX_CENTER;
#define LED_MATRIX_CUSTOM_EFFECT_IMPLS
#include "led_matrix_effects.inc"
+#ifdef COMMUNITY_MODULES_ENABLE
+# include "led_matrix_community_modules.inc"
+#endif
#ifdef LED_MATRIX_CUSTOM_KB
# include "led_matrix_kb.inc"
#endif
@@ -86,9 +88,9 @@ static last_hit_t last_hit_buffer;
const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT;
#endif
-EECONFIG_DEBOUNCE_HELPER(led_matrix, EECONFIG_LED_MATRIX, led_matrix_eeconfig);
+EECONFIG_DEBOUNCE_HELPER(led_matrix, led_matrix_eeconfig);
-void eeconfig_update_led_matrix(void) {
+void eeconfig_force_flush_led_matrix(void) {
eeconfig_flush_led_matrix(true);
}
@@ -283,6 +285,15 @@ static void led_task_render(uint8_t effect) {
#include "led_matrix_effects.inc"
#undef LED_MATRIX_EFFECT
+#ifdef COMMUNITY_MODULES_ENABLE
+# define LED_MATRIX_EFFECT(name, ...) \
+ case LED_MATRIX_COMMUNITY_MODULE_##name: \
+ rendering = name(&led_effect_params); \
+ break;
+# include "led_matrix_community_modules.inc"
+# undef LED_MATRIX_EFFECT
+#endif
+
#if defined(LED_MATRIX_CUSTOM_KB) || defined(LED_MATRIX_CUSTOM_USER)
# define LED_MATRIX_EFFECT(name, ...) \
case LED_MATRIX_CUSTOM_##name: \
@@ -359,7 +370,12 @@ void led_matrix_task(void) {
}
}
+__attribute__((weak)) bool led_matrix_indicators_modules(void) {
+ return true;
+}
+
void led_matrix_indicators(void) {
+ led_matrix_indicators_modules();
led_matrix_indicators_kb();
}
@@ -371,6 +387,10 @@ __attribute__((weak)) bool led_matrix_indicators_user(void) {
return true;
}
+__attribute__((weak)) bool led_matrix_indicators_advanced_modules(uint8_t led_min, uint8_t led_max) {
+ return true;
+}
+
void led_matrix_indicators_advanced(effect_params_t *params) {
/* special handling is needed for "params->iter", since it's already been incremented.
* Could move the invocations to led_task_render, but then it's missing a few checks
@@ -378,6 +398,7 @@ void led_matrix_indicators_advanced(effect_params_t *params) {
* led_task_render, right before the iter++ line.
*/
LED_MATRIX_USE_LIMITS_ITER(min, max, params->iter - 1);
+ led_matrix_indicators_advanced_modules(min, max);
led_matrix_indicators_advanced_kb(min, max);
}