diff options
author | Jumail Mundekkat <mundekkat@hotmail.com> | 2020-02-18 14:05:22 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 14:05:22 +1100 |
commit | 0f500eb336690f5052cb76a7ee77c2c18c20a779 (patch) | |
tree | 69daa0660670ba74794b49a7d68e8ff007a5dbef /keyboards/mxss/rgblight.c | |
parent | 675ac4ac4a8e9d4a53eb947628a034bc78fcc553 (diff) | |
download | qmk_firmware-0f500eb336690f5052cb76a7ee77c2c18c20a779.tar.gz |
MxSS RGB Handler Touchup (#8105)
* Minor fix to improve front LED brightness config
* Updated rgblight.c
Diffstat (limited to 'keyboards/mxss/rgblight.c')
-rw-r--r-- | keyboards/mxss/rgblight.c | 20 |
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) { #endif } +void eeconfig_update_rgblight_current(void) { + eeconfig_update_rgblight(rgblight_config.raw); +} + void eeconfig_update_rgblight_default(void) { rgblight_config.enable = 1; 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 void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } +uint8_t rgblight_get_speed(void) { return rgblight_config.speed; } + +void rgblight_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { + rgblight_config.speed = speed; + if (write_to_eeprom) { + eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this + dprintf("rgblight set speed [EEPROM]: %u\n", rgblight_config.speed); + } else { + dprintf("rgblight set speed [NOEEPROM]: %u\n", rgblight_config.speed); + } +} + +void rgblight_set_speed(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, true); } + +void rgblight_set_speed_noeeprom(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, false); } + uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } |