From 6910ed2de5c8935712b646e1c2143c4e7e5f9bea Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 29 Sep 2023 18:31:21 +0100 Subject: Add _DEFAULT_ON lighting configuration options (#21865) --- quantum/backlight/backlight.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'quantum/backlight') diff --git a/quantum/backlight/backlight.c b/quantum/backlight/backlight.c index 9d9f944f5d..e89b34696c 100644 --- a/quantum/backlight/backlight.c +++ b/quantum/backlight/backlight.c @@ -22,10 +22,21 @@ along with this program. If not, see . backlight_config_t backlight_config; +#ifndef BACKLIGHT_DEFAULT_ON +# define BACKLIGHT_DEFAULT_ON true +#endif + #ifndef BACKLIGHT_DEFAULT_LEVEL # define BACKLIGHT_DEFAULT_LEVEL BACKLIGHT_LEVELS #endif +#ifndef BACKLIGHT_DEFAULT_BREATHING +# define BACKLIGHT_DEFAULT_BREATHING false +#else +# undef BACKLIGHT_DEFAULT_BREATHING +# define BACKLIGHT_DEFAULT_BREATHING true +#endif + #ifdef BACKLIGHT_BREATHING // TODO: migrate to backlight_config_t static uint8_t breathing_period = BREATHING_PERIOD; @@ -172,13 +183,9 @@ void eeconfig_update_backlight_current(void) { } void eeconfig_update_backlight_default(void) { - backlight_config.enable = 1; -#ifdef BACKLIGHT_DEFAULT_BREATHING - backlight_config.breathing = 1; -#else - backlight_config.breathing = 0; -#endif - backlight_config.level = BACKLIGHT_DEFAULT_LEVEL; + backlight_config.enable = BACKLIGHT_DEFAULT_ON; + backlight_config.breathing = BACKLIGHT_DEFAULT_BREATHING; + backlight_config.level = BACKLIGHT_DEFAULT_LEVEL; eeconfig_update_backlight(backlight_config.raw); } -- cgit v1.2.3