diff options
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r-- | quantum/rgblight.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 52d8da181..211ec975a 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
@@ -407,7 +407,6 @@ void rgblight_decrease_val_helper(bool write_to_eeprom) { | |||
407 | void rgblight_decrease_val_noeeprom(void) { rgblight_decrease_val_helper(false); } | 407 | void rgblight_decrease_val_noeeprom(void) { rgblight_decrease_val_helper(false); } |
408 | void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); } | 408 | void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); } |
409 | 409 | ||
410 | |||
411 | void rgblight_increase_speed_helper(bool write_to_eeprom) { | 410 | void rgblight_increase_speed_helper(bool write_to_eeprom) { |
412 | if (rgblight_config.speed < 3) rgblight_config.speed++; | 411 | if (rgblight_config.speed < 3) rgblight_config.speed++; |
413 | // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED? | 412 | // RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED? |
@@ -428,7 +427,6 @@ void rgblight_decrease_speed_helper(bool write_to_eeprom) { | |||
428 | void rgblight_decrease_speed(void) { rgblight_decrease_speed_helper(true); } | 427 | void rgblight_decrease_speed(void) { rgblight_decrease_speed_helper(true); } |
429 | void rgblight_decrease_speed_noeeprom(void) { rgblight_decrease_speed_helper(false); } | 428 | void rgblight_decrease_speed_noeeprom(void) { rgblight_decrease_speed_helper(false); } |
430 | 429 | ||
431 | |||
432 | void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { | 430 | void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) { |
433 | if (rgblight_config.enable) { | 431 | if (rgblight_config.enable) { |
434 | LED_TYPE tmp_led; | 432 | LED_TYPE tmp_led; |
@@ -1170,17 +1168,17 @@ void rgblight_effect_knight(animation_status_t *anim) { | |||
1170 | */ | 1168 | */ |
1171 | void rgblight_effect_christmas(animation_status_t *anim) { | 1169 | void rgblight_effect_christmas(animation_status_t *anim) { |
1172 | static int8_t increment = 1; | 1170 | static int8_t increment = 1; |
1173 | const uint8_t max_pos = 32; | 1171 | const uint8_t max_pos = 32; |
1174 | const uint8_t hue_green = 85; | 1172 | const uint8_t hue_green = 85; |
1175 | 1173 | ||
1176 | uint32_t xa; | 1174 | uint32_t xa; |
1177 | uint8_t hue, val; | 1175 | uint8_t hue, val; |
1178 | uint8_t i; | 1176 | uint8_t i; |
1179 | 1177 | ||
1180 | // The effect works by animating anim->pos from 0 to 32 and back to 0. | 1178 | // The effect works by animating anim->pos from 0 to 32 and back to 0. |
1181 | // The pos is used in a cubic bezier formula to ease-in-out between red and green, leaving the interpolated colors visible as short as possible. | 1179 | // The pos is used in a cubic bezier formula to ease-in-out between red and green, leaving the interpolated colors visible as short as possible. |
1182 | xa = CUBED((uint32_t) anim->pos); | 1180 | xa = CUBED((uint32_t)anim->pos); |
1183 | hue = ((uint32_t) hue_green) * xa / (xa + CUBED((uint32_t) (max_pos - anim->pos))); | 1181 | hue = ((uint32_t)hue_green) * xa / (xa + CUBED((uint32_t)(max_pos - anim->pos))); |
1184 | // Additionally, these interpolated colors get shown with a slightly darker value, to make them less prominent than the main colors. | 1182 | // Additionally, these interpolated colors get shown with a slightly darker value, to make them less prominent than the main colors. |
1185 | val = 255 - (3 * (hue < hue_green / 2 ? hue : hue_green - hue) / 2); | 1183 | val = 255 - (3 * (hue < hue_green / 2 ? hue : hue_green - hue) / 2); |
1186 | 1184 | ||