diff options
-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 3f19747d28..3c4309f070 100644 --- a/keyboards/mxss/mxss_frontled.c +++ b/keyboards/mxss/mxss_frontled.c @@ -183,7 +183,14 @@ void fled_val_increase(void) // Update stored config fled_update_conf(); - rgblight_set(); + + // Update and set LED state + if (fled_mode == FLED_INDI) { + fled_layer_update(layer_state); + fled_lock_update(host_keyboard_led_state()); + } else { + rgblight_set(); + } } void fled_val_decrease(void) @@ -196,7 +203,14 @@ void fled_val_decrease(void) // Update stored config fled_update_conf(); - rgblight_set(); + + // Update and set LED state + if (fled_mode == FLED_INDI) { + fled_layer_update(layer_state); + fled_lock_update(host_keyboard_led_state()); + } else { + rgblight_set(); + } } void fled_layer_update(layer_state_t state) { diff --git a/keyboards/mxss/rgblight.c b/keyboards/mxss/rgblight.c index 9e17510b59..ec4d70e17c 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; } diff --git a/keyboards/mxss/rgblight.h b/keyboards/mxss/rgblight.h index e3aa098e4d..f6746e50ff 100644 --- a/keyboards/mxss/rgblight.h +++ b/keyboards/mxss/rgblight.h @@ -233,6 +233,11 @@ void rgblight_decrease_speed(void); void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); +/* effect speed */ +uint8_t rgblight_get_speed(void); +void rgblight_set_speed(uint8_t speed); +void rgblight_set_speed_noeeprom(uint8_t speed); + /* query */ uint8_t rgblight_get_mode(void); uint8_t rgblight_get_hue(void); @@ -245,6 +250,7 @@ uint32_t rgblight_read_dword(void); void rgblight_update_dword(uint32_t dword); uint32_t eeconfig_read_rgblight(void); void eeconfig_update_rgblight(uint32_t val); +void eeconfig_update_rgblight_current(void); void eeconfig_update_rgblight_default(void); void eeconfig_debug_rgblight(void); |