diff options
| author | QMK Bot <hello@qmk.fm> | 2020-03-10 20:24:13 +0000 |
|---|---|---|
| committer | QMK Bot <hello@qmk.fm> | 2020-03-10 20:24:13 +0000 |
| commit | 1aa40dde46ae38e2768fd23e4d7a3bdd8838f724 (patch) | |
| tree | 5db72dfae3dd6d3f6d5e3247b37e56cc795e3859 /quantum/rgblight.h | |
| parent | 2ffb08843ba59f0af0870335934bdb277fc85620 (diff) | |
| download | qmk_firmware-1aa40dde46ae38e2768fd23e4d7a3bdd8838f724.tar.gz qmk_firmware-1aa40dde46ae38e2768fd23e4d7a3bdd8838f724.zip | |
format code according to conventions [skip ci]
Diffstat (limited to 'quantum/rgblight.h')
| -rw-r--r-- | quantum/rgblight.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 40f267daa..97882c5b2 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
| @@ -172,25 +172,28 @@ enum RGBLIGHT_EFFECT_MODE { | |||
| 172 | 172 | ||
| 173 | # ifdef RGBLIGHT_LAYERS | 173 | # ifdef RGBLIGHT_LAYERS |
| 174 | typedef struct { | 174 | typedef struct { |
| 175 | uint8_t index; // The first LED to light | 175 | uint8_t index; // The first LED to light |
| 176 | uint8_t count; // The number of LEDs to light | 176 | uint8_t count; // The number of LEDs to light |
| 177 | uint8_t hue; | 177 | uint8_t hue; |
| 178 | uint8_t sat; | 178 | uint8_t sat; |
| 179 | uint8_t val; | 179 | uint8_t val; |
| 180 | } rgblight_segment_t; | 180 | } rgblight_segment_t; |
| 181 | 181 | ||
| 182 | # define RGBLIGHT_END_SEGMENT_INDEX (255) | 182 | # define RGBLIGHT_END_SEGMENT_INDEX (255) |
| 183 | # define RGBLIGHT_END_SEGMENTS {RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0} | 183 | # define RGBLIGHT_END_SEGMENTS \ |
| 184 | { RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0 } | ||
| 184 | # define RGBLIGHT_MAX_LAYERS 8 | 185 | # define RGBLIGHT_MAX_LAYERS 8 |
| 185 | # define RGBLIGHT_LAYER_SEGMENTS(...) { __VA_ARGS__, RGBLIGHT_END_SEGMENTS } | 186 | # define RGBLIGHT_LAYER_SEGMENTS(...) \ |
| 186 | # define RGBLIGHT_LAYERS_LIST(...) { __VA_ARGS__, NULL } | 187 | { __VA_ARGS__, RGBLIGHT_END_SEGMENTS } |
| 188 | # define RGBLIGHT_LAYERS_LIST(...) \ | ||
| 189 | { __VA_ARGS__, NULL } | ||
| 187 | 190 | ||
| 188 | // Get/set enabled rgblight layers | 191 | // Get/set enabled rgblight layers |
| 189 | void rgblight_set_layer_state(uint8_t layer, bool enabled); | 192 | void rgblight_set_layer_state(uint8_t layer, bool enabled); |
| 190 | bool rgblight_get_layer_state(uint8_t layer); | 193 | bool rgblight_get_layer_state(uint8_t layer); |
| 191 | 194 | ||
| 192 | // Point this to an array of rgblight_segment_t arrays in keyboard_post_init_user to use rgblight layers | 195 | // Point this to an array of rgblight_segment_t arrays in keyboard_post_init_user to use rgblight layers |
| 193 | extern const rgblight_segment_t * const * rgblight_layers; | 196 | extern const rgblight_segment_t *const *rgblight_layers; |
| 194 | # endif | 197 | # endif |
| 195 | 198 | ||
| 196 | extern LED_TYPE led[RGBLED_NUM]; | 199 | extern LED_TYPE led[RGBLED_NUM]; |
| @@ -320,19 +323,19 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); | |||
| 320 | # define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) | 323 | # define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) |
| 321 | void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); | 324 | void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); |
| 322 | 325 | ||
| 323 | #ifdef RGBLIGHT_USE_TIMER | 326 | # ifdef RGBLIGHT_USE_TIMER |
| 324 | void rgblight_task(void); | 327 | void rgblight_task(void); |
| 325 | void rgblight_timer_init(void); | 328 | void rgblight_timer_init(void); |
| 326 | void rgblight_timer_enable(void); | 329 | void rgblight_timer_enable(void); |
| 327 | void rgblight_timer_disable(void); | 330 | void rgblight_timer_disable(void); |
| 328 | void rgblight_timer_toggle(void); | 331 | void rgblight_timer_toggle(void); |
| 329 | #else | 332 | # else |
| 330 | #define rgblight_task() | 333 | # define rgblight_task() |
| 331 | #define rgblight_timer_init() | 334 | # define rgblight_timer_init() |
| 332 | #define rgblight_timer_enable() | 335 | # define rgblight_timer_enable() |
| 333 | #define rgblight_timer_disable() | 336 | # define rgblight_timer_disable() |
| 334 | #define rgblight_timer_toggle() | 337 | # define rgblight_timer_toggle() |
| 335 | #endif | 338 | # endif |
| 336 | 339 | ||
| 337 | # ifdef RGBLIGHT_SPLIT | 340 | # ifdef RGBLIGHT_SPLIT |
| 338 | # define RGBLIGHT_STATUS_CHANGE_MODE (1 << 0) | 341 | # define RGBLIGHT_STATUS_CHANGE_MODE (1 << 0) |
