summaryrefslogtreecommitdiffstats
path: root/users/drashna/rgb_matrix_stuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/rgb_matrix_stuff.c')
-rw-r--r--users/drashna/rgb_matrix_stuff.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/users/drashna/rgb_matrix_stuff.c b/users/drashna/rgb_matrix_stuff.c
index 9e9e1e4279..97811092c1 100644
--- a/users/drashna/rgb_matrix_stuff.c
+++ b/users/drashna/rgb_matrix_stuff.c
@@ -20,11 +20,6 @@
extern led_config_t g_led_config;
static uint32_t hypno_timer;
-#if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd)
-# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL
-#else
-# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
-#endif
void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) {
HSV hsv = {hue, sat, val};
@@ -34,27 +29,27 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode
switch (mode) {
case 1: // breathing
- {
- uint16_t time = scale16by8(g_rgb_timer, speed / 8);
- hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v);
- RGB rgb = hsv_to_rgb(hsv);
- for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
- if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
- RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
+ {
+ uint16_t time = scale16by8(g_rgb_timer, speed / 8);
+ hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v);
+ RGB rgb = hsv_to_rgb(hsv);
+ for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
+ if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
+ RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
+ }
}
+ break;
}
- break;
- }
default: // Solid Color
- {
- RGB rgb = hsv_to_rgb(hsv);
- for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
- if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
- RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
+ {
+ RGB rgb = hsv_to_rgb(hsv);
+ for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
+ if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
+ RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
+ }
}
+ break;
}
- break;
- }
}
}