diff options
author | Florian Didron <fdidron@users.noreply.github.com> | 2019-05-06 10:35:24 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 10:35:24 +0900 |
commit | 270ab0d3fb6a85cee797c6e75ac87ce295c038a8 (patch) | |
tree | af78ff21a685eb7e9eb1d372aee43abcf9143618 /quantum/rgblight.h | |
parent | 4f2efc06cec72205d1e14eee38f3124e25e18e23 (diff) | |
parent | 43aae47b383fe2490112d5ee9180d6978ff2a177 (diff) |
Merge branch 'master' into feature/unicode_map_improvements
Diffstat (limited to 'quantum/rgblight.h')
-rw-r--r-- | quantum/rgblight.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 748d009dcf..35d7942ca6 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -80,9 +80,7 @@ enum RGBLIGHT_EFFECT_MODE { #define RGBLIGHT_MODES (RGBLIGHT_MODE_last-1) -#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7 -#endif +// sample: #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 #ifndef RGBLIGHT_EFFECT_BREATHE_MAX #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255 @@ -113,7 +111,7 @@ enum RGBLIGHT_EFFECT_MODE { #endif #ifndef RGBLIGHT_HUE_STEP -#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_HUE_STEP 8 #endif #ifndef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 17 @@ -151,12 +149,13 @@ extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; extern bool is_rgblight_initialized; +// Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now) typedef union { uint32_t raw; struct { bool enable :1; - uint8_t mode :6; - uint16_t hue :9; + uint8_t mode :7; + uint8_t hue :8; uint8_t sat :8; uint8_t val :8; uint8_t speed :8;//EECONFIG needs to be increased to support this @@ -211,19 +210,19 @@ void rgblight_increase_val(void); void rgblight_decrease_val(void); void rgblight_increase_speed(void); void rgblight_decrease_speed(void); -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); -uint16_t rgblight_get_hue(void); +void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val); +uint8_t rgblight_get_hue(void); uint8_t rgblight_get_sat(void); uint8_t rgblight_get_val(void); void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index); -void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index); +void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index); void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end); -void rgblight_sethsv_range(uint16_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end); +void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end); void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b); void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b); -void rgblight_sethsv_master(uint16_t hue, uint8_t sat, uint8_t val); -void rgblight_sethsv_slave(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val); void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds); uint32_t eeconfig_read_rgblight(void); @@ -234,10 +233,10 @@ void eeconfig_debug_rgblight(void); void rgb_matrix_increase(void); void rgb_matrix_decrease(void); -void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); +void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1); -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val); void rgblight_mode_noeeprom(uint8_t mode); void rgblight_toggle_noeeprom(void); void rgblight_enable_noeeprom(void); @@ -251,7 +250,7 @@ void rgblight_decrease_sat_noeeprom(void); void rgblight_increase_val_noeeprom(void); void rgblight_decrease_val_noeeprom(void); -void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); +void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); @@ -274,7 +273,7 @@ typedef struct _animation_status_t { union { uint16_t pos16; uint8_t pos; - int16_t current_hue; + int8_t current_hue; uint16_t current_offset; }; } animation_status_t; |