diff options
Diffstat (limited to 'quantum/rgblight')
-rw-r--r-- | quantum/rgblight/rgblight.c | 12 | ||||
-rw-r--r-- | quantum/rgblight/rgblight.h | 5 |
2 files changed, 10 insertions, 7 deletions
diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c index 19d80e0097..02188df95b 100644 --- a/quantum/rgblight/rgblight.c +++ b/quantum/rgblight/rgblight.c @@ -21,6 +21,7 @@ #include "rgblight.h" #include "color.h" #include "debug.h" +#include "util.h" #include "led_tables.h" #include <lib/lib8tion/lib8tion.h> #ifdef EEPROM_ENABLE @@ -30,13 +31,6 @@ # include "velocikey.h" #endif -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - #ifdef RGBLIGHT_SPLIT /* for split keyboard */ # define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE @@ -422,6 +416,10 @@ void rgblight_disable_noeeprom(void) { rgblight_set(); } +void rgblight_enabled_noeeprom(bool state) { + state ? rgblight_enable_noeeprom() : rgblight_disable_noeeprom(); +} + bool rgblight_is_enabled(void) { return rgblight_config.enable; } diff --git a/quantum/rgblight/rgblight.h b/quantum/rgblight/rgblight.h index 7693888462..2e85541313 100644 --- a/quantum/rgblight/rgblight.h +++ b/quantum/rgblight/rgblight.h @@ -174,6 +174,10 @@ typedef struct { uint8_t val; } rgblight_segment_t; +// rgblight_set_layer_state doesn't take effect until the next time +// rgblight_task runs, so timers must be enabled for layers to work. +# define RGBLIGHT_USE_TIMER + # define RGBLIGHT_END_SEGMENT_INDEX (255) # define RGBLIGHT_END_SEGMENTS \ { RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0 } @@ -321,6 +325,7 @@ void rgblight_enable(void); void rgblight_enable_noeeprom(void); void rgblight_disable(void); void rgblight_disable_noeeprom(void); +void rgblight_enabled_noeeprom(bool state); /* hue, sat, val change */ void rgblight_increase_hue(void); |