aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgblight.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r--quantum/rgblight.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 26887f057..85b319110 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -160,6 +160,10 @@ void eeconfig_update_rgblight(uint32_t val) {
160#endif 160#endif
161} 161}
162 162
163void eeconfig_update_rgblight_current(void) {
164 eeconfig_update_rgblight(rgblight_config.raw);
165}
166
163void eeconfig_update_rgblight_default(void) { 167void eeconfig_update_rgblight_default(void) {
164 rgblight_config.enable = 1; 168 rgblight_config.enable = 1;
165 rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; 169 rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
@@ -501,6 +505,22 @@ void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_ee
501 505
502void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } 506void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); }
503 507
508uint8_t rgblight_get_speed(void) { return rgblight_config.speed; }
509
510void rgblight_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) {
511 rgblight_config.speed = speed;
512 if (write_to_eeprom) {
513 eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this
514 dprintf("rgblight set speed [EEPROM]: %u\n", rgblight_config.speed);
515 } else {
516 dprintf("rgblight set speed [NOEEPROM]: %u\n", rgblight_config.speed);
517 }
518}
519
520void rgblight_set_speed(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, true); }
521
522void rgblight_set_speed_noeeprom(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, false); }
523
504uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } 524uint8_t rgblight_get_hue(void) { return rgblight_config.hue; }
505 525
506uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } 526uint8_t rgblight_get_sat(void) { return rgblight_config.sat; }