1
0
Fork 0

Convert clipping variables in rgblight.c to a structure (#7720)

This commit is contained in:
Drashna Jael're 2020-04-29 01:22:28 -07:00 committed by GitHub
parent 5f5c2a219c
commit 86c4c4e91d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 65 deletions

View file

@ -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 <stdint.h>
# include <stdbool.h>
# 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