diff options
author | Frank Tackitt <franklyn@tackitt.net> | 2018-11-07 09:25:18 -0700 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2018-11-07 08:25:18 -0800 |
commit | 94f58322ac3dde1a4694733c51a44c4d24ec3fc0 (patch) | |
tree | 1095c69452358a88d05165eb5386e41a7bed3734 /quantum | |
parent | a30dd2bb1711f5402007adf89af9b3adb758a7fb (diff) | |
download | qmk_firmware-94f58322ac3dde1a4694733c51a44c4d24ec3fc0.tar.gz |
Configurable Rainbow Swirl range (#4376)
* Configurable Rainbow Swirl range
This allows tweaking of the rainbow effect to
get different effects on keyboards with varied
LED layouts. We found the value 1950 works on
the RGBKB.net Sol to get a cool striped effect
across the keyboard.
* Document RGBLIGHT_RAINBOW_SWIRL_RANGE
* Better wording for the documentation
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/rgblight.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 94e9c0a3b..9ce3b2309 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -679,6 +679,10 @@ void rgblight_effect_rainbow_mood(uint8_t interval) { #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#ifndef RGBLIGHT_RAINBOW_SWIRL_RANGE + #define RGBLIGHT_RAINBOW_SWIRL_RANGE 360 +#endif + __attribute__ ((weak)) const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; @@ -692,7 +696,7 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) { } last_timer = timer_read(); for (i = 0; i < RGBLED_NUM; i++) { - hue = (360 / RGBLED_NUM * i + current_hue) % 360; + hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / RGBLED_NUM * i + current_hue) % 360; sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); } rgblight_set(); |