From 3edc43964d35986a4cc5eb4602e1d79b8be1bf01 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 11 May 2021 13:41:06 +1000 Subject: LED Matrix: Effects! (#12651) --- quantum/led_matrix_animations/alpha_mods_anim.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 quantum/led_matrix_animations/alpha_mods_anim.h (limited to 'quantum/led_matrix_animations/alpha_mods_anim.h') diff --git a/quantum/led_matrix_animations/alpha_mods_anim.h b/quantum/led_matrix_animations/alpha_mods_anim.h new file mode 100644 index 0000000000..a4638fde69 --- /dev/null +++ b/quantum/led_matrix_animations/alpha_mods_anim.h @@ -0,0 +1,24 @@ +#ifndef DISABLE_LED_MATRIX_ALPHAS_MODS +LED_MATRIX_EFFECT(ALPHAS_MODS) +# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS + +// alphas = val1, mods = val2 +bool ALPHAS_MODS(effect_params_t* params) { + LED_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t val1 = led_matrix_eeconfig.val; + uint8_t val2 = val1 + led_matrix_eeconfig.speed; + + for (uint8_t i = led_min; i < led_max; i++) { + LED_MATRIX_TEST_LED_FLAGS(); + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + led_matrix_set_value(i, val2); + } else { + led_matrix_set_value(i, val1); + } + } + return led_max < DRIVER_LED_TOTAL; +} + +# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // DISABLE_LED_MATRIX_ALPHAS_MODS -- cgit v1.2.3