aboutsummaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-08-25 02:08:09 -0700
committerGitHub <noreply@github.com>2020-08-25 19:08:09 +1000
commitb338a4d8867f69bd6a92ec92e306715a4ae41740 (patch)
treed81d23c6928ef771e3fad133db5f7c1ec0dd8e99 /quantum
parent1fd2f2f02227e969d4bde1ae88cd4eaa2f0ab242 (diff)
downloadfirmware-b338a4d8867f69bd6a92ec92e306715a4ae41740.tar.gz
firmware-b338a4d8867f69bd6a92ec92e306715a4ae41740.tar.bz2
firmware-b338a4d8867f69bd6a92ec92e306715a4ae41740.zip
Add noeeprom speed function for RGBLIGHT (#9706)
* [Docs] Add Speed functions to RGB Light docs * Add noeeprom functions for speed * Fix wording in doc Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgblight.c19
-rw-r--r--quantum/rgblight.h2
2 files changed, 17 insertions, 4 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index d33484ccf..f9e9da167 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -406,17 +406,28 @@ void rgblight_decrease_val_helper(bool write_to_eeprom) {
}
void rgblight_decrease_val_noeeprom(void) { rgblight_decrease_val_helper(false); }
void rgblight_decrease_val(void) { rgblight_decrease_val_helper(true); }
-void rgblight_increase_speed(void) {
+
+
+void rgblight_increase_speed_helper(bool write_to_eeprom) {
if (rgblight_config.speed < 3) rgblight_config.speed++;
// RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED?
- eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this
+ if (write_to_eeprom) {
+ eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this
+ }
}
+void rgblight_increase_speed(void) { rgblight_increase_speed_helper(true); }
+void rgblight_increase_speed_noeeprom(void) { rgblight_increase_speed_helper(false); }
-void rgblight_decrease_speed(void) {
+void rgblight_decrease_speed_helper(bool write_to_eeprom) {
if (rgblight_config.speed > 0) rgblight_config.speed--;
// RGBLIGHT_SPLIT_SET_CHANGE_HSVS; // NEED??
- eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this
+ if (write_to_eeprom) {
+ eeconfig_update_rgblight(rgblight_config.raw); // EECONFIG needs to be increased to support this
+ }
}
+void rgblight_decrease_speed(void) { rgblight_decrease_speed_helper(true); }
+void rgblight_decrease_speed_noeeprom(void) { rgblight_decrease_speed_helper(false); }
+
void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) {
if (rgblight_config.enable) {
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index c36b328a3..7b2696294 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -336,7 +336,9 @@ void rgblight_increase_val_noeeprom(void);
void rgblight_decrease_val(void);
void rgblight_decrease_val_noeeprom(void);
void rgblight_increase_speed(void);
+void rgblight_increase_speed_noeeprom(void);
void rgblight_decrease_speed(void);
+void rgblight_decrease_speed_noeeprom(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);