diff options
Diffstat (limited to 'quantum/rgblight.c')
| -rw-r--r-- | quantum/rgblight.c | 20 |
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 | ||
| 163 | void eeconfig_update_rgblight_current(void) { | ||
| 164 | eeconfig_update_rgblight(rgblight_config.raw); | ||
| 165 | } | ||
| 166 | |||
| 163 | void eeconfig_update_rgblight_default(void) { | 167 | void 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 | ||
| 502 | void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } | 506 | void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } |
| 503 | 507 | ||
| 508 | uint8_t rgblight_get_speed(void) { return rgblight_config.speed; } | ||
| 509 | |||
| 510 | void 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 | |||
| 520 | void rgblight_set_speed(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, true); } | ||
| 521 | |||
| 522 | void rgblight_set_speed_noeeprom(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, false); } | ||
| 523 | |||
| 504 | uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } | 524 | uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } |
| 505 | 525 | ||
| 506 | uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } | 526 | uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } |
