summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-02-17 02:51:28 +1100
committerGitHub <noreply@github.com>2021-02-16 10:51:28 -0500
commit53b96f685d3399e1281747b11a1194178089706c (patch)
treebac3e0e884e5778b2fbab893fab2d31e17ab5aaa /quantum
parent02b5bb9b17f90d0b741b3b7128e61ac747ab4d6c (diff)
downloadqmk_firmware-53b96f685d3399e1281747b11a1194178089706c.tar.gz
qmk_firmware-53b96f685d3399e1281747b11a1194178089706c.zip
RGBLight: Allow configurable default settings (#11912)
* RGBLight: Allow configurable default settings * Docs
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgblight.c30
1 files changed, 25 insertions, 5 deletions
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);
}