diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-10-05 20:41:33 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-10-05 20:41:38 -0400 |
commit | b8679bbe045a2285d6ab6bbc420121b26f516b9a (patch) | |
tree | 1303c1e74649194ca7f8056dc91b386cbf6684fc /quantum | |
parent | d465e3f0c384654b4e65f4dc031a0c7422cdf853 (diff) |
RGBW lights
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/rgblight.c | 18 | ||||
-rw-r--r-- | quantum/rgblight.h | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index f82e3ec558..801ca1d0d9 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -50,7 +50,11 @@ const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; rgblight_config_t rgblight_config; rgblight_config_t inmem_config; -struct cRGB led[RGBLED_NUM]; +#ifdef RGBW + struct cRGBW led[RGBLED_NUM]; +#else + struct cRGB led[RGBLED_NUM]; +#endif uint8_t rgblight_inited = 0; @@ -334,14 +338,22 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { void rgblight_set(void) { if (rgblight_config.enable) { - ws2812_setleds(led, RGBLED_NUM); + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif } else { for (uint8_t i = 0; i < RGBLED_NUM; i++) { led[i].r = 0; led[i].g = 0; led[i].b = 0; } - ws2812_setleds(led, RGBLED_NUM); + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif } } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index def26c428c..2a712d8be4 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -1,6 +1,7 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H +#define RGBW 1 #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) #define RGBLIGHT_MODES 23 |