From 86c4c4e91de20b3f928300cfab617963c31699f9 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 29 Apr 2020 01:22:28 -0700 Subject: Convert clipping variables in rgblight.c to a structure (#7720) --- quantum/rgblight.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'quantum/rgblight.h') diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 97882c5b29..b1585b158b 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -130,7 +130,7 @@ enum RGBLIGHT_EFFECT_MODE { # endif # ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM -# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM (effect_num_leds) +# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM (rgblight_ranges.effect_num_leds) # endif # ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL @@ -160,9 +160,7 @@ enum RGBLIGHT_EFFECT_MODE { # include # include # include "eeconfig.h" -# ifndef RGBLIGHT_CUSTOM_DRIVER -# include "ws2812.h" -# endif +# include "ws2812.h" # include "color.h" # include "rgblight_list.h" @@ -230,6 +228,19 @@ typedef struct _rgblight_status_t { # endif } rgblight_status_t; +/* + * Structure for RGB Light clipping ranges + */ +typedef struct _rgblight_ranges_t { + uint8_t clipping_start_pos; + uint8_t clipping_num_leds; + uint8_t effect_start_pos; + uint8_t effect_end_pos; + uint8_t effect_num_leds; +} rgblight_ranges_t; + +extern rgblight_ranges_t rgblight_ranges; + /* === Utility Functions ===*/ void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check -- cgit v1.2.3