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 | |
| parent | 675ac4ac4a8e9d4a53eb947628a034bc78fcc553 (diff) | |
| download | qmk_firmware-0f500eb336690f5052cb76a7ee77c2c18c20a779.tar.gz qmk_firmware-0f500eb336690f5052cb76a7ee77c2c18c20a779.zip | |
MxSS RGB Handler Touchup (#8105)
* Minor fix to improve front LED brightness config
* Updated rgblight.c
Diffstat (limited to 'keyboards/mxss')
| -rw-r--r-- | keyboards/mxss/mxss_frontled.c | 18 | ||||
| -rw-r--r-- | keyboards/mxss/rgblight.c | 20 | ||||
| -rw-r--r-- | keyboards/mxss/rgblight.h | 6 |
3 files changed, 42 insertions, 2 deletions
diff --git a/keyboards/mxss/mxss_frontled.c b/keyboards/mxss/mxss_frontled.c index 3f19747d2..3c4309f07 100644 --- a/keyboards/mxss/mxss_frontled.c +++ b/keyboards/mxss/mxss_frontled.c | |||
| @@ -183,7 +183,14 @@ void fled_val_increase(void) | |||
| 183 | 183 | ||
| 184 | // Update stored config | 184 | // Update stored config |
| 185 | fled_update_conf(); | 185 | fled_update_conf(); |
| 186 | rgblight_set(); | 186 | |
| 187 | // Update and set LED state | ||
| 188 | if (fled_mode == FLED_INDI) { | ||
| 189 | fled_layer_update(layer_state); | ||
| 190 | fled_lock_update(host_keyboard_led_state()); | ||
| 191 | } else { | ||
| 192 | rgblight_set(); | ||
| 193 | } | ||
| 187 | } | 194 | } |
| 188 | 195 | ||
| 189 | void fled_val_decrease(void) | 196 | void fled_val_decrease(void) |
| @@ -196,7 +203,14 @@ void fled_val_decrease(void) | |||
| 196 | 203 | ||
| 197 | // Update stored config | 204 | // Update stored config |
| 198 | fled_update_conf(); | 205 | fled_update_conf(); |
| 199 | rgblight_set(); | 206 | |
| 207 | // Update and set LED state | ||
| 208 | if (fled_mode == FLED_INDI) { | ||
| 209 | fled_layer_update(layer_state); | ||
| 210 | fled_lock_update(host_keyboard_led_state()); | ||
| 211 | } else { | ||
| 212 | rgblight_set(); | ||
| 213 | } | ||
| 200 | } | 214 | } |
| 201 | 215 | ||
| 202 | void fled_layer_update(layer_state_t state) { | 216 | void fled_layer_update(layer_state_t state) { |
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 | ||
| 185 | void eeconfig_update_rgblight_current(void) { | ||
| 186 | eeconfig_update_rgblight(rgblight_config.raw); | ||
| 187 | } | ||
| 188 | |||
| 185 | void eeconfig_update_rgblight_default(void) { | 189 | void 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 | ||
| 534 | void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } | 538 | void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_eeprom_helper(hue, sat, val, false); } |
| 535 | 539 | ||
| 540 | uint8_t rgblight_get_speed(void) { return rgblight_config.speed; } | ||
| 541 | |||
| 542 | void 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 | |||
| 552 | void rgblight_set_speed(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, true); } | ||
| 553 | |||
| 554 | void rgblight_set_speed_noeeprom(uint8_t speed) { rgblight_set_speed_eeprom_helper(speed, false); } | ||
| 555 | |||
| 536 | uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } | 556 | uint8_t rgblight_get_hue(void) { return rgblight_config.hue; } |
| 537 | 557 | ||
| 538 | uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } | 558 | uint8_t rgblight_get_sat(void) { return rgblight_config.sat; } |
diff --git a/keyboards/mxss/rgblight.h b/keyboards/mxss/rgblight.h index e3aa098e4..f6746e50f 100644 --- a/keyboards/mxss/rgblight.h +++ b/keyboards/mxss/rgblight.h | |||
| @@ -233,6 +233,11 @@ void rgblight_decrease_speed(void); | |||
| 233 | void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); | 233 | void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); |
| 234 | void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); | 234 | void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); |
| 235 | 235 | ||
| 236 | /* effect speed */ | ||
| 237 | uint8_t rgblight_get_speed(void); | ||
| 238 | void rgblight_set_speed(uint8_t speed); | ||
| 239 | void rgblight_set_speed_noeeprom(uint8_t speed); | ||
| 240 | |||
| 236 | /* query */ | 241 | /* query */ |
| 237 | uint8_t rgblight_get_mode(void); | 242 | uint8_t rgblight_get_mode(void); |
| 238 | uint8_t rgblight_get_hue(void); | 243 | uint8_t rgblight_get_hue(void); |
| @@ -245,6 +250,7 @@ uint32_t rgblight_read_dword(void); | |||
| 245 | void rgblight_update_dword(uint32_t dword); | 250 | void rgblight_update_dword(uint32_t dword); |
| 246 | uint32_t eeconfig_read_rgblight(void); | 251 | uint32_t eeconfig_read_rgblight(void); |
| 247 | void eeconfig_update_rgblight(uint32_t val); | 252 | void eeconfig_update_rgblight(uint32_t val); |
| 253 | void eeconfig_update_rgblight_current(void); | ||
| 248 | void eeconfig_update_rgblight_default(void); | 254 | void eeconfig_update_rgblight_default(void); |
| 249 | void eeconfig_debug_rgblight(void); | 255 | void eeconfig_debug_rgblight(void); |
| 250 | 256 | ||
