aboutsummaryrefslogtreecommitdiff
path: root/keyboards/mxss/rgblight.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/mxss/rgblight.c')
-rw-r--r--keyboards/mxss/rgblight.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/keyboards/mxss/rgblight.c b/keyboards/mxss/rgblight.c
index 9e17510b5..ec4d70e17 100644
--- a/keyboards/mxss/rgblight.c
+++ b/keyboards/mxss/rgblight.c
@@ -182,6 +182,10 @@ void eeconfig_update_rgblight(uint32_t val) {
182#endif 182#endif
183} 183}
184 184
185void eeconfig_update_rgblight_current(void) {
186 eeconfig_update_rgblight(rgblight_config.raw);
187}
188
185void eeconfig_update_rgblight_default(void) { 189void eeconfig_update_rgblight_default(void) {
186 rgblight_config.enable = 1; 190 rgblight_config.enable = 1;
187 rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; 191 rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
@@ -533,6 +537,22 @@ void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_ee
533 537
534void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } 538void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); }
535 539
540uint8_t rgblight_get_speed(void) { return rgblight_config.speed; }
541
542void rgblight_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) {
543 rgblight_config.speed = speed;
544 if (write_to_eeprom) {
545 eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this
546 dprintf("rgblight set speed [EEPROM]: %u\n", rgblight_config.speed);
547 } else {
548 dprintf("rgblight set speed [NOEEPROM]: %u\n", rgblight_config.speed);
549 }
550}
551
552void rgblight_set_speed(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, true); }
553
554void rgblight_set_speed_noeeprom(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, false); }
555
536uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } 556uint8_t rgblight_get_hue(void) { return rgblight_config.hue; }
537 557
538uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } 558uint8_t rgblight_get_sat(void) { return rgblight_config.sat; }