aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/rgblight.c8
-rw-r--r--quantum/rgblight.h8
2 files changed, 12 insertions, 4 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 52a09817a..f91f3caff 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -237,7 +237,7 @@ void rgblight_mode(uint8_t mode) {
237 #ifdef RGBLIGHT_ANIMATIONS 237 #ifdef RGBLIGHT_ANIMATIONS
238 rgblight_timer_disable(); 238 rgblight_timer_disable();
239 #endif 239 #endif
240 } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { 240 } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 24) {
241 // MODE 2-5, breathing 241 // MODE 2-5, breathing
242 // MODE 6-8, rainbow mood 242 // MODE 6-8, rainbow mood
243 // MODE 9-14, rainbow swirl 243 // MODE 9-14, rainbow swirl
@@ -450,7 +450,7 @@ void rgblight_task(void) {
450 } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { 450 } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) {
451 // mode = 21 to 23, knight mode 451 // mode = 21 to 23, knight mode
452 rgblight_effect_knight(rgblight_config.mode - 21); 452 rgblight_effect_knight(rgblight_config.mode - 21);
453 } else { 453 } else if (rgblight_config.mode == 24) {
454 // mode = 24, christmas mode 454 // mode = 24, christmas mode
455 rgblight_effect_christmas(); 455 rgblight_effect_christmas();
456 } 456 }
@@ -604,13 +604,13 @@ void rgblight_effect_christmas(void) {
604 static uint16_t last_timer = 0; 604 static uint16_t last_timer = 0;
605 uint16_t hue; 605 uint16_t hue;
606 uint8_t i; 606 uint8_t i;
607 if (timer_elapsed(last_timer) < 1000) { 607 if (timer_elapsed(last_timer) < RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL) {
608 return; 608 return;
609 } 609 }
610 last_timer = timer_read(); 610 last_timer = timer_read();
611 current_offset = (current_offset + 1) % 2; 611 current_offset = (current_offset + 1) % 2;
612 for (i = 0; i < RGBLED_NUM; i++) { 612 for (i = 0; i < RGBLED_NUM; i++) {
613 hue = 0 + ((RGBLED_NUM * (i + current_offset)) % 2) * 80; 613 hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + current_offset) % 2) * 120;
614 sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); 614 sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]);
615 } 615 }
616 rgblight_set(); 616 rgblight_set();
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index 726b8de72..12e858305 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -22,6 +22,14 @@
22#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4 22#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4
23#endif 23#endif
24 24
25#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
26#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
27#endif
28
29#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP
30#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2
31#endif
32
25#ifndef RGBLIGHT_HUE_STEP 33#ifndef RGBLIGHT_HUE_STEP
26#define RGBLIGHT_HUE_STEP 10 34#define RGBLIGHT_HUE_STEP 10
27#endif 35#endif