X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Frgb_matrix_animations%2Fcycle_all_anim.h;h=380dbe05a483629ae27eaac822fbdb87809bcb0b;hb=207e50c5347adeb6d66c092d5f41d7dc52d4a166;hp=5c18cfa0c912d6ffc8ce31bec86a8586e501f5bf;hpb=908966bdf36605301d27cdcae82c3201c156a43f;p=qmk_firmware.git diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index 5c18cfa0c..380dbe05a 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h @@ -1,21 +1,15 @@ -#pragma once #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL +RGB_MATRIX_EFFECT(CYCLE_ALL) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; -extern rgb_config_t rgb_matrix_config; - -bool rgb_matrix_cycle_all(effect_params_t* params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); +static void CYCLE_ALL_math(HSV* hsv, uint8_t i, uint8_t time) +{ + hsv->h = time; +} - HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; - uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); - for (uint8_t i = led_min; i < led_max; i++) { - hsv.h = time; - RGB rgb = hsv_to_rgb(hsv); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - return led_max < DRIVER_LED_TOTAL; +bool CYCLE_ALL(effect_params_t* params) { + return effect_runner_i(params, &CYCLE_ALL_math); } +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS #endif // DISABLE_RGB_MATRIX_CYCLE_ALL