-
-
Notifications
You must be signed in to change notification settings - Fork 40.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
554 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef DISABLE_LED_MATRIX_ALPHAS_MODS | ||
LED_MATRIX_EFFECT(ALPHAS_MODS) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
// alphas = val1, mods = val2 | ||
bool ALPHAS_MODS(effect_params_t* params) { | ||
LED_MATRIX_USE_LIMITS(led_min, led_max); | ||
|
||
uint8_t val1 = led_matrix_eeconfig.val; | ||
uint8_t val2 = val1 + led_matrix_eeconfig.speed; | ||
|
||
for (uint8_t i = led_min; i < led_max; i++) { | ||
LED_MATRIX_TEST_LED_FLAGS(); | ||
if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | ||
led_matrix_set_value(i, val2); | ||
} else { | ||
led_matrix_set_value(i, val1); | ||
} | ||
} | ||
return led_max < DRIVER_LED_TOTAL; | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_ALPHAS_MODS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef DISABLE_LED_MATRIX_BAND | ||
LED_MATRIX_EFFECT(BAND) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t BAND_math(uint8_t val, uint8_t i, uint8_t time) { | ||
int16_t v = val - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8; | ||
return scale8(v < 0 ? 0 : v, val); | ||
} | ||
|
||
bool BAND(effect_params_t* params) { | ||
return effect_runner_i(params, &BAND_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_BAND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DISABLE_LED_MATRIX_BAND_PINWHEEL | ||
LED_MATRIX_EFFECT(BAND_PINWHEEL) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t BAND_PINWHEEL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t time) { | ||
return scale8(val - time - atan2_8(dy, dx) * 3, val); | ||
} | ||
|
||
bool BAND_PINWHEEL(effect_params_t* params) { | ||
return effect_runner_dx_dy(params, &BAND_PINWHEEL_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_BAND_PINWHEEL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DISABLE_LED_MATRIX_BAND_SPIRAL | ||
LED_MATRIX_EFFECT(BAND_SPIRAL) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t BAND_SPIRAL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { | ||
return scale8(val + dist - time - atan2_8(dy, dx), val); | ||
} | ||
|
||
bool BAND_SPIRAL(effect_params_t* params) { | ||
return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_BAND_SPIRAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef DISABLE_LED_MATRIX_BREATHING | ||
LED_MATRIX_EFFECT(BREATHING) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
bool BREATHING(effect_params_t* params) { | ||
LED_MATRIX_USE_LIMITS(led_min, led_max); | ||
|
||
uint8_t val = led_matrix_eeconfig.val; | ||
uint16_t time = scale16by8(g_led_timer, led_matrix_eeconfig.speed / 8); | ||
val = scale8(abs8(sin8(time) - 128) * 2, val); | ||
for (uint8_t i = led_min; i < led_max; i++) { | ||
LED_MATRIX_TEST_LED_FLAGS(); | ||
led_matrix_set_value(i, val); | ||
} | ||
return led_max < DRIVER_LED_TOTAL; | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_BREATHING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT | ||
LED_MATRIX_EFFECT(CYCLE_LEFT_RIGHT) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t CYCLE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { | ||
return scale8(g_led_config.point[i].x - time, val); | ||
} | ||
|
||
bool CYCLE_LEFT_RIGHT(effect_params_t* params) { | ||
return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DISABLE_LED_MATRIX_CYCLE_OUT_IN | ||
LED_MATRIX_EFFECT(CYCLE_OUT_IN) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t CYCLE_OUT_IN_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { | ||
return scale8(3 * dist / 2 + time, val); | ||
} | ||
|
||
bool CYCLE_OUT_IN(effect_params_t* params) { | ||
return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_CYCLE_OUT_IN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DISABLE_LED_MATRIX_CYCLE_UP_DOWN | ||
LED_MATRIX_EFFECT(CYCLE_UP_DOWN) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t CYCLE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { | ||
return scale8(g_led_config.point[i].y - time, val); | ||
} | ||
|
||
bool CYCLE_UP_DOWN(effect_params_t* params) { | ||
return effect_runner_i(params, &CYCLE_UP_DOWN_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_CYCLE_UP_DOWN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef DISABLE_LED_MATRIX_DUAL_BEACON | ||
LED_MATRIX_EFFECT(DUAL_BEACON) | ||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t DUAL_BEACON_math(uint8_t val, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { | ||
return scale8(((g_led_config.point[i].y - k_led_matrix_center.y) * cos + (g_led_config.point[i].x - k_led_matrix_center.x) * sin) / 128, val); | ||
} | ||
|
||
bool DUAL_BEACON(effect_params_t* params) { | ||
return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); | ||
} | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
#endif // DISABLE_LED_MATRIX_DUAL_BEACON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Add your new core led matrix effect here, order determins enum order, requires "led_matrix_animations/ directory | ||
#include "led_matrix_animations/solid_anim.h" | ||
#include "led_matrix_animations/alpha_mods_anim.h" | ||
#include "led_matrix_animations/breathing_anim.h" | ||
#include "led_matrix_animations/band_anim.h" | ||
#include "led_matrix_animations/band_pinwheel_anim.h" | ||
#include "led_matrix_animations/band_spiral_anim.h" | ||
#include "led_matrix_animations/cycle_left_right_anim.h" | ||
#include "led_matrix_animations/cycle_up_down_anim.h" | ||
#include "led_matrix_animations/cycle_out_in_anim.h" | ||
#include "led_matrix_animations/dual_beacon_anim.h" | ||
#include "led_matrix_animations/solid_reactive_simple_anim.h" | ||
#include "led_matrix_animations/solid_reactive_wide.h" | ||
#include "led_matrix_animations/solid_reactive_cross.h" | ||
#include "led_matrix_animations/solid_reactive_nexus.h" | ||
#include "led_matrix_animations/solid_splash_anim.h" | ||
#include "led_matrix_animations/wave_left_right_anim.h" | ||
#include "led_matrix_animations/wave_up_down_anim.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
LED_MATRIX_EFFECT(SOLID) | ||
#ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
bool SOLID(effect_params_t* params) { | ||
LED_MATRIX_USE_LIMITS(led_min, led_max); | ||
|
||
uint8_t val = led_matrix_eeconfig.val; | ||
for (uint8_t i = led_min; i < led_max; i++) { | ||
LED_MATRIX_TEST_LED_FLAGS(); | ||
led_matrix_set_value(i, val); | ||
} | ||
return led_max < DRIVER_LED_TOTAL; | ||
} | ||
|
||
#endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifdef LED_MATRIX_KEYREACTIVE_ENABLED | ||
# if !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS) | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS | ||
LED_MATRIX_EFFECT(SOLID_REACTIVE_CROSS) | ||
# endif | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
LED_MATRIX_EFFECT(SOLID_REACTIVE_MULTICROSS) | ||
# endif | ||
|
||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t SOLID_REACTIVE_CROSS_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { | ||
uint16_t effect = tick + dist; | ||
dx = dx < 0 ? dx * -1 : dx; | ||
dy = dy < 0 ? dy * -1 : dy; | ||
dx = dx * 16 > 255 ? 255 : dx * 16; | ||
dy = dy * 16 > 255 ? 255 : dy * 16; | ||
effect += dx > dy ? dy : dx; | ||
if (effect > 255) effect = 255; | ||
return qadd8(val, 255 - effect); | ||
} | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS | ||
bool SOLID_REACTIVE_CROSS(effect_params_t* params) { | ||
return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); | ||
} | ||
# endif | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { | ||
return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); | ||
} | ||
# endif | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS) | ||
#endif // LED_MATRIX_KEYREACTIVE_ENABLED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifdef LED_MATRIX_KEYREACTIVE_ENABLED | ||
# if !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS | ||
LED_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS) | ||
# endif | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
LED_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS) | ||
# endif | ||
|
||
# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
|
||
static uint8_t SOLID_REACTIVE_NEXUS_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { | ||
uint16_t effect = tick - dist; | ||
if (effect > 255) effect = 255; | ||
if (dist > 72) effect = 255; | ||
if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255; | ||
return qadd8(val, 255 - effect); | ||
} | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS | ||
bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { | ||
return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); | ||
} | ||
# endif | ||
|
||
# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { | ||
return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); | ||
} | ||
# endif | ||
|
||
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) | ||
#endif // LED_MATRIX_KEYREACTIVE_ENABLED |
Oops, something went wrong.