diff options
Diffstat (limited to 'quantum/rgb_matrix_runners/effect_runner_reactive.h')
| -rw-r--r-- | quantum/rgb_matrix_runners/effect_runner_reactive.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/quantum/rgb_matrix_runners/effect_runner_reactive.h b/quantum/rgb_matrix_runners/effect_runner_reactive.h index 94cd7d545..9da2814ce 100644 --- a/quantum/rgb_matrix_runners/effect_runner_reactive.h +++ b/quantum/rgb_matrix_runners/effect_runner_reactive.h | |||
| @@ -2,12 +2,11 @@ | |||
| 2 | 2 | ||
| 3 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 3 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 4 | 4 | ||
| 5 | typedef void (*reactive_f)(HSV* hsv, uint16_t offset); | 5 | typedef HSV (*reactive_f)(HSV hsv, uint16_t offset); |
| 6 | 6 | ||
| 7 | bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { | 7 | bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { |
| 8 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 8 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 9 | 9 | ||
| 10 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; | ||
| 11 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; | 10 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; |
| 12 | for (uint8_t i = led_min; i < led_max; i++) { | 11 | for (uint8_t i = led_min; i < led_max; i++) { |
| 13 | RGB_MATRIX_TEST_LED_FLAGS(); | 12 | RGB_MATRIX_TEST_LED_FLAGS(); |
| @@ -21,8 +20,7 @@ bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { | |||
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | uint16_t offset = scale16by8(tick, rgb_matrix_config.speed); | 22 | uint16_t offset = scale16by8(tick, rgb_matrix_config.speed); |
| 24 | effect_func(&hsv, offset); | 23 | RGB rgb = hsv_to_rgb(effect_func(rgb_matrix_config.hsv, offset)); |
| 25 | RGB rgb = hsv_to_rgb(hsv); | ||
| 26 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 24 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
| 27 | } | 25 | } |
| 28 | return led_max < DRIVER_LED_TOTAL; | 26 | return led_max < DRIVER_LED_TOTAL; |
