From d856f404bdc95dda07ee58e56028bd1dfee3d1ac Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Wed, 8 Aug 2018 02:09:01 +0900 Subject: [PATCH] configurable each effect compile on/off in config.h --- quantum/rgblight.h | 13 +------------ quantum/rgblight_reconfig.h | 36 +++++++++++++++++++++++++++++++++++ tmk_core/common/avr/suspend.c | 1 + tmk_core/protocol/lufa/lufa.c | 1 + 4 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 quantum/rgblight_reconfig.h diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 9d98a8dafb..d1e00eef31 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -16,18 +16,7 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#ifdef RGBLIGHT_ANIMATIONS - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - #define RGBLIGHT_EFFECT_SNAKE - #define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - #define RGBLIGHT_EFFECT_RGB_TEST - #define RGBLIGHT_EFFECT_ALTERNATING - #define RGBLIGHT_USE_TIMER -#endif +#include "rgblight_reconfig.h" #define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, diff --git a/quantum/rgblight_reconfig.h b/quantum/rgblight_reconfig.h new file mode 100644 index 0000000000..0877c299d8 --- /dev/null +++ b/quantum/rgblight_reconfig.h @@ -0,0 +1,36 @@ +#ifndef RGBLIGHT_RECONFIG_H +#define RGBLIGHT_RECONFIG_H + +#ifdef RGBLIGHT_ANIMATIONS + // for backword compatibility + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_RGB_TEST + #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +#ifdef RGBLIGHT_STATIC_PATTERNS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT +#endif + +// check dynamic animation effects chose ? +#if defined(RGBLIGHT_EFFECT_BREATHING) || \ + defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) || \ + defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) || \ + defined(RGBLIGHT_EFFECT_SNAKE) || \ + defined(RGBLIGHT_EFFECT_KNIGHT) || \ + defined(RGBLIGHT_EFFECT_CHRISTMAS) || \ + defined(RGBLIGHT_EFFECT_RGB_TEST) || \ + defined(RGBLIGHT_EFFECT_ALTERNATING) + #define RGBLIGHT_USE_TIMER + #ifndef RGBLIGHT_ANIMATIONS + #define RGBLIGHT_ANIMATIONS // for backword compatibility + #endif +#endif + +#endif // RGBLIGHT_RECONFIG_H diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 3d4a48439b..bc9c36e49f 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -10,6 +10,7 @@ #include "timer.h" #include "led.h" #include "host.h" +#include "rgblight_reconfig.h" #ifdef PROTOCOL_LUFA #include "lufa.h" diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index cb918d3dce..95e0b95b2f 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -54,6 +54,7 @@ #include "quantum.h" #include #include "outputselect.h" +#include "rgblight_reconfig.h" #ifdef NKRO_ENABLE #include "keycode_config.h"