diff options
| author | Joshua Diamond <josh@windowoffire.com> | 2020-05-09 04:56:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-09 01:56:16 -0700 |
| commit | 2fe7e221ec9e412cc008aa5c03eaf27e35ff62c6 (patch) | |
| tree | 79ae7e86cfb9048b3bd9795b596ec318581d801e /quantum/rgblight.h | |
| parent | e0f548085cc9c29e85122d393e74143eb5de1d4d (diff) | |
| download | qmk_firmware-2fe7e221ec9e412cc008aa5c03eaf27e35ff62c6.tar.gz qmk_firmware-2fe7e221ec9e412cc008aa5c03eaf27e35ff62c6.zip | |
New RGB Lighting effect: Twinkle (#8887)
* Add twinkle RGB Lighting effect
* 2nd twinkle algo - double-buffering
* Further refinement: Per-LED twinkle
* Add documentation for Twinkle RBG Lighting mode
* Bias twinkle saturation closer to the set value
* Fix whitespace
Diffstat (limited to 'quantum/rgblight.h')
| -rw-r--r-- | quantum/rgblight.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index e06073728..7de9c3f3d 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
| @@ -59,6 +59,12 @@ | |||
| 59 | | 34 | RGBLIGHT_MODE_STATIC_GRADIENT + 9 | | 59 | | 34 | RGBLIGHT_MODE_STATIC_GRADIENT + 9 | |
| 60 | | 35 | RGBLIGHT_MODE_RGB_TEST | | 60 | | 35 | RGBLIGHT_MODE_RGB_TEST | |
| 61 | | 36 | RGBLIGHT_MODE_ALTERNATING | | 61 | | 36 | RGBLIGHT_MODE_ALTERNATING | |
| 62 | | 37 | RGBLIGHT_MODE_TWINKLE | | ||
| 63 | | 38 | RGBLIGHT_MODE_TWINKLE + 1 | | ||
| 64 | | 39 | RGBLIGHT_MODE_TWINKLE + 2 | | ||
| 65 | | 40 | RGBLIGHT_MODE_TWINKLE + 3 | | ||
| 66 | | 41 | RGBLIGHT_MODE_TWINKLE + 4 | | ||
| 67 | | 42 | RGBLIGHT_MODE_TWINKLE + 5 | | ||
| 62 | |-----------------|-----------------------------------| | 68 | |-----------------|-----------------------------------| |
| 63 | *****/ | 69 | *****/ |
| 64 | 70 | ||
| @@ -73,6 +79,7 @@ | |||
| 73 | # define RGBLIGHT_EFFECT_STATIC_GRADIENT | 79 | # define RGBLIGHT_EFFECT_STATIC_GRADIENT |
| 74 | # define RGBLIGHT_EFFECT_RGB_TEST | 80 | # define RGBLIGHT_EFFECT_RGB_TEST |
| 75 | # define RGBLIGHT_EFFECT_ALTERNATING | 81 | # define RGBLIGHT_EFFECT_ALTERNATING |
| 82 | # define RGBLIGHT_EFFECT_TWINKLE | ||
| 76 | #endif | 83 | #endif |
| 77 | 84 | ||
| 78 | #ifdef RGBLIGHT_STATIC_PATTERNS | 85 | #ifdef RGBLIGHT_STATIC_PATTERNS |
| @@ -89,7 +96,8 @@ | |||
| 89 | || defined(RGBLIGHT_EFFECT_KNIGHT) \ | 96 | || defined(RGBLIGHT_EFFECT_KNIGHT) \ |
| 90 | || defined(RGBLIGHT_EFFECT_CHRISTMAS) \ | 97 | || defined(RGBLIGHT_EFFECT_CHRISTMAS) \ |
| 91 | || defined(RGBLIGHT_EFFECT_RGB_TEST) \ | 98 | || defined(RGBLIGHT_EFFECT_RGB_TEST) \ |
| 92 | || defined(RGBLIGHT_EFFECT_ALTERNATING) | 99 | || defined(RGBLIGHT_EFFECT_ALTERNATING) \ |
| 100 | || defined(RGBLIGHT_EFFECT_TWINKLE) | ||
| 93 | # define RGBLIGHT_USE_TIMER | 101 | # define RGBLIGHT_USE_TIMER |
| 94 | #endif | 102 | #endif |
| 95 | 103 | ||
| @@ -141,6 +149,14 @@ enum RGBLIGHT_EFFECT_MODE { | |||
| 141 | # define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 | 149 | # define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 |
| 142 | # endif | 150 | # endif |
| 143 | 151 | ||
| 152 | # ifndef RGBLIGHT_EFFECT_TWINKLE_LIFE | ||
| 153 | # define RGBLIGHT_EFFECT_TWINKLE_LIFE 75 | ||
| 154 | # endif | ||
| 155 | |||
| 156 | # ifndef RGBLIGHT_EFFECT_TWINKLE_PROBABILITY | ||
| 157 | # define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1/127 | ||
| 158 | # endif | ||
| 159 | |||
| 144 | # ifndef RGBLIGHT_HUE_STEP | 160 | # ifndef RGBLIGHT_HUE_STEP |
| 145 | # define RGBLIGHT_HUE_STEP 8 | 161 | # define RGBLIGHT_HUE_STEP 8 |
| 146 | # endif | 162 | # endif |
| @@ -208,6 +224,7 @@ extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM; | |||
| 208 | extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM; | 224 | extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM; |
| 209 | extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; | 225 | extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; |
| 210 | extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; | 226 | extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; |
| 227 | extern const uint8_t RGBLED_TWINKLE_INTERVALS[3] PROGMEM; | ||
| 211 | extern bool is_rgblight_initialized; | 228 | extern bool is_rgblight_initialized; |
| 212 | 229 | ||
| 213 | // Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now) | 230 | // Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now) |
| @@ -398,6 +415,7 @@ void rgblight_effect_knight(animation_status_t *anim); | |||
| 398 | void rgblight_effect_christmas(animation_status_t *anim); | 415 | void rgblight_effect_christmas(animation_status_t *anim); |
| 399 | void rgblight_effect_rgbtest(animation_status_t *anim); | 416 | void rgblight_effect_rgbtest(animation_status_t *anim); |
| 400 | void rgblight_effect_alternating(animation_status_t *anim); | 417 | void rgblight_effect_alternating(animation_status_t *anim); |
| 418 | void rgblight_effect_twinkle(animation_status_t *anim); | ||
| 401 | 419 | ||
| 402 | # endif | 420 | # endif |
| 403 | 421 | ||
