diff options
author | Ryan <fauxpark@gmail.com> | 2021-06-22 18:26:23 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 18:26:23 +1000 |
commit | d61e5c0027e289ccf48652afa4c442342e7ccf04 (patch) | |
tree | e8edc86d191a190691b4722f05e32bdc40affc58 /quantum/led_matrix/animations/solid_reactive_wide.h | |
parent | c03cb4edd7ff73391a0a64f0c4f5e0755e902908 (diff) | |
download | qmk_firmware-d61e5c0027e289ccf48652afa4c442342e7ccf04.tar.gz qmk_firmware-d61e5c0027e289ccf48652afa4c442342e7ccf04.zip |
Move LED/RGB Matrix code into their own directories (#13257)
Diffstat (limited to 'quantum/led_matrix/animations/solid_reactive_wide.h')
-rw-r--r-- | quantum/led_matrix/animations/solid_reactive_wide.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/quantum/led_matrix/animations/solid_reactive_wide.h b/quantum/led_matrix/animations/solid_reactive_wide.h new file mode 100644 index 000000000..922e32fe5 --- /dev/null +++ b/quantum/led_matrix/animations/solid_reactive_wide.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifdef LED_MATRIX_KEYREACTIVE_ENABLED | ||
2 | # if !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE) | ||
3 | |||
4 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE | ||
5 | LED_MATRIX_EFFECT(SOLID_REACTIVE_WIDE) | ||
6 | # endif | ||
7 | |||
8 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
9 | LED_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE) | ||
10 | # endif | ||
11 | |||
12 | # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
13 | |||
14 | static uint8_t SOLID_REACTIVE_WIDE_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { | ||
15 | uint16_t effect = tick + dist * 5; | ||
16 | if (effect > 255) effect = 255; | ||
17 | return qadd8(val, 255 - effect); | ||
18 | } | ||
19 | |||
20 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE | ||
21 | bool SOLID_REACTIVE_WIDE(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); } | ||
22 | # endif | ||
23 | |||
24 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
25 | bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); } | ||
26 | # endif | ||
27 | |||
28 | # endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
29 | # endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE) | ||
30 | #endif // LED_MATRIX_KEYREACTIVE_ENABLED | ||