summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/feature_rgblight.md23
-rw-r--r--quantum/rgblight.c30
2 files changed, 39 insertions, 14 deletions
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md
index b5a2b179d6..d2612a6d1b 100644
--- a/docs/feature_rgblight.md
+++ b/docs/feature_rgblight.md
@@ -82,15 +82,20 @@ Changing the **Value** sets the overall brightness.<br>
Your RGB lighting can be configured by placing these `#define`s in your `config.h`:
-|Define |Default |Description |
-|---------------------|-------------|-----------------------------------------------------------------------------|
-|`RGBLIGHT_HUE_STEP` |`10` |The number of steps to cycle through the hue by |
-|`RGBLIGHT_SAT_STEP` |`17` |The number of steps to increment the saturation by |
-|`RGBLIGHT_VAL_STEP` |`17` |The number of steps to increment the brightness by |
-|`RGBLIGHT_LIMIT_VAL` |`255` |The maximum brightness level |
-|`RGBLIGHT_SLEEP` |*Not defined*|If defined, the RGB lighting will be switched off when the host goes to sleep|
-|`RGBLIGHT_SPLIT` |*Not defined*|If defined, synchronization functionality for split keyboards is added|
-|`RGBLIGHT_DISABLE_KEYCODES`|*not defined*|If defined, disables the ability to control RGB Light from the keycodes. You must use code functions to control the feature|
+|Define |Default |Description |
+|---------------------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------|
+|`RGBLIGHT_HUE_STEP` |`10` |The number of steps to cycle through the hue by |
+|`RGBLIGHT_SAT_STEP` |`17` |The number of steps to increment the saturation by |
+|`RGBLIGHT_VAL_STEP` |`17` |The number of steps to increment the brightness by |
+|`RGBLIGHT_LIMIT_VAL` |`255` |The maximum brightness level |
+|`RGBLIGHT_SLEEP` |*Not defined* |If defined, the RGB lighting will be switched off when the host goes to sleep |
+|`RGBLIGHT_SPLIT` |*Not defined* |If defined, synchronization functionality for split keyboards is added |
+|`RGBLIGHT_DISABLE_KEYCODES`|*Not defined* |If defined, disables the ability to control RGB Light from the keycodes. You must use code functions to control the feature|
+|`RGBLIGHT_DEFAULT_MODE` |`RGBLIGHT_MODE_STATIC_LIGHT`|The default mode to use upon clearing the EEPROM |
+|`RGBLIGHT_DEFAULT_HUE` |`0` (red) |The default hue to use upon clearing the EEPROM |
+|`RGBLIGHT_DEFAULT_SAT` |`UINT8_MAX` (255) |The default saturation to use upon clearing the EEPROM |
+|`RGBLIGHT_DEFAULT_VAL` |`RGBLIGHT_LIMIT_VAL` |The default value (brightness) to use upon clearing the EEPROM |
+|`RGBLIGHT_DEFAULT_SPD` |`0` |The default speed to use upon clearing the EEPROM |
## Effects and Animations
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 7d7d015ba0..904c02d6cd 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -84,6 +84,26 @@ static uint8_t mode_base_table[] = {
#include "rgblight_modes.h"
};
+#if !defined(RGBLIGHT_DEFAULT_MODE)
+# define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_LIGHT
+#endif
+
+#if !defined(RGBLIGHT_DEFAULT_HUE)
+# define RGBLIGHT_DEFAULT_HUE 0
+#endif
+
+#if !defined(RGBLIGHT_DEFAULT_SAT)
+# define RGBLIGHT_DEFAULT_SAT UINT8_MAX
+#endif
+
+#if !defined(RGBLIGHT_DEFAULT_VAL)
+# define RGBLIGHT_DEFAULT_VAL RGBLIGHT_LIMIT_VAL
+#endif
+
+#if !defined(RGBLIGHT_DEFAULT_SPD)
+# define RGBLIGHT_DEFAULT_SPD 0
+#endif
+
static inline int is_static_effect(uint8_t mode) { return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; }
#ifdef RGBLIGHT_LED_MAP
@@ -183,11 +203,11 @@ void eeconfig_update_rgblight_current(void) { eeconfig_update_rgblight(rgblight_
void eeconfig_update_rgblight_default(void) {
rgblight_config.enable = 1;
- rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
- rgblight_config.hue = 0;
- rgblight_config.sat = UINT8_MAX;
- rgblight_config.val = RGBLIGHT_LIMIT_VAL;
- rgblight_config.speed = 0;
+ rgblight_config.mode = RGBLIGHT_DEFAULT_MODE;
+ rgblight_config.hue = RGBLIGHT_DEFAULT_HUE;
+ rgblight_config.sat = RGBLIGHT_DEFAULT_SAT;
+ rgblight_config.val = RGBLIGHT_DEFAULT_VAL;
+ rgblight_config.speed = RGBLIGHT_DEFAULT_SPD;
RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS;
eeconfig_update_rgblight(rgblight_config.raw);
}