aboutsummaryrefslogtreecommitdiff
path: root/keyboards/mxss
diff options
context:
space:
mode:
authorJumail Mundekkat <mundekkat@hotmail.com>2020-02-18 14:05:22 +1100
committerGitHub <noreply@github.com>2020-02-18 14:05:22 +1100
commit0f500eb336690f5052cb76a7ee77c2c18c20a779 (patch)
tree69daa0660670ba74794b49a7d68e8ff007a5dbef /keyboards/mxss
parent675ac4ac4a8e9d4a53eb947628a034bc78fcc553 (diff)
downloadqmk_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.c18
-rw-r--r--keyboards/mxss/rgblight.c20
-rw-r--r--keyboards/mxss/rgblight.h6
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
189void fled_val_decrease(void) 196void 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
202void fled_layer_update(layer_state_t state) { 216void 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
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; }
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);
233void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); 233void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val);
234void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); 234void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val);
235 235
236/* effect speed */
237uint8_t rgblight_get_speed(void);
238void rgblight_set_speed(uint8_t speed);
239void rgblight_set_speed_noeeprom(uint8_t speed);
240
236/* query */ 241/* query */
237uint8_t rgblight_get_mode(void); 242uint8_t rgblight_get_mode(void);
238uint8_t rgblight_get_hue(void); 243uint8_t rgblight_get_hue(void);
@@ -245,6 +250,7 @@ uint32_t rgblight_read_dword(void);
245void rgblight_update_dword(uint32_t dword); 250void rgblight_update_dword(uint32_t dword);
246uint32_t eeconfig_read_rgblight(void); 251uint32_t eeconfig_read_rgblight(void);
247void eeconfig_update_rgblight(uint32_t val); 252void eeconfig_update_rgblight(uint32_t val);
253void eeconfig_update_rgblight_current(void);
248void eeconfig_update_rgblight_default(void); 254void eeconfig_update_rgblight_default(void);
249void eeconfig_debug_rgblight(void); 255void eeconfig_debug_rgblight(void);
250 256