Move LED/RGB Matrix code into their own directories (#13257)

This commit is contained in:
Ryan
2021-06-22 18:26:23 +10:00
committed by GitHub
parent c03cb4edd7
commit d61e5c0027
80 changed files with 108 additions and 100 deletions

View File

@ -230,9 +230,12 @@ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162))
# ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
OPT_DEFS += -DLIB8_ATTINY
endif
SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c
SRC += $(QUANTUM_DIR)/led_matrix.c
SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
COMMON_VPATH += $(QUANTUM_DIR)/led_matrix
COMMON_VPATH += $(QUANTUM_DIR)/led_matrix/animations
COMMON_VPATH += $(QUANTUM_DIR)/led_matrix/animations/runners
SRC += process_backlight.c
SRC += led_matrix.c
SRC += led_matrix_drivers.c
CIE1931_CURVE := yes
ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731)
@ -255,9 +258,12 @@ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 at90usb162))
# ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
OPT_DEFS += -DLIB8_ATTINY
endif
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgb_matrix.c
SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c
COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix
COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations
COMMON_VPATH += $(QUANTUM_DIR)/rgb_matrix/animations/runners
SRC += color.c
SRC += rgb_matrix.c
SRC += rgb_matrix_drivers.c
CIE1931_CURVE := yes
RGB_KEYCODES_ENABLE := yes

View File

@ -21,4 +21,4 @@ bool ALPHAS_MODS(effect_params_t* params) {
}
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_LED_MATRIX_ALPHAS_MODS
#endif // DISABLE_LED_MATRIX_ALPHAS_MODS

View File

@ -10,4 +10,4 @@ static uint8_t BAND_math(uint8_t val, uint8_t i, uint8_t time) {
bool BAND(effect_params_t* params) { return effect_runner_i(params, &BAND_math); }
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_LED_MATRIX_BAND
#endif // DISABLE_LED_MATRIX_BAND

View File

@ -7,4 +7,4 @@ static uint8_t BAND_PINWHEEL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t t
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
#endif // DISABLE_LED_MATRIX_BAND_PINWHEEL

View File

@ -7,4 +7,4 @@ static uint8_t BAND_SPIRAL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dis
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
#endif // DISABLE_LED_MATRIX_BAND_SPIRAL

View File

@ -16,4 +16,4 @@ bool BREATHING(effect_params_t* params) {
}
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_LED_MATRIX_BREATHING
#endif // DISABLE_LED_MATRIX_BREATHING

View File

@ -7,4 +7,4 @@ static uint8_t CYCLE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { ret
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
#endif // DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT

View File

@ -7,4 +7,4 @@ static uint8_t CYCLE_OUT_IN_math(uint8_t val, int16_t dx, int16_t dy, uint8_t di
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
#endif // DISABLE_LED_MATRIX_CYCLE_OUT_IN

View File

@ -7,4 +7,4 @@ static uint8_t CYCLE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { return
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
#endif // DISABLE_LED_MATRIX_CYCLE_UP_DOWN

View File

@ -7,4 +7,4 @@ static uint8_t DUAL_BEACON_math(uint8_t val, int8_t sin, int8_t cos, uint8_t i,
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
#endif // DISABLE_LED_MATRIX_DUAL_BEACON

View File

@ -0,0 +1,18 @@
// Add your new core led matrix effect here, order determines enum order
#include "solid_anim.h"
#include "alpha_mods_anim.h"
#include "breathing_anim.h"
#include "band_anim.h"
#include "band_pinwheel_anim.h"
#include "band_spiral_anim.h"
#include "cycle_left_right_anim.h"
#include "cycle_up_down_anim.h"
#include "cycle_out_in_anim.h"
#include "dual_beacon_anim.h"
#include "solid_reactive_simple_anim.h"
#include "solid_reactive_wide.h"
#include "solid_reactive_cross.h"
#include "solid_reactive_nexus.h"
#include "solid_splash_anim.h"
#include "wave_left_right_anim.h"
#include "wave_up_down_anim.h"

View File

@ -0,0 +1,6 @@
#include "effect_runner_dx_dy_dist.h"
#include "effect_runner_dx_dy.h"
#include "effect_runner_i.h"
#include "effect_runner_sin_cos_i.h"
#include "effect_runner_reactive.h"
#include "effect_runner_reactive_splash.h"

View File

@ -31,5 +31,5 @@ bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { return effect_runner_r
# 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
# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS)
#endif // LED_MATRIX_KEYREACTIVE_ENABLED

View File

@ -28,5 +28,5 @@ bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_r
# 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
# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS)
#endif // LED_MATRIX_KEYREACTIVE_ENABLED

View File

@ -8,5 +8,5 @@ static uint8_t SOLID_REACTIVE_SIMPLE_math(uint8_t val, uint16_t offset) { return
bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); }
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
# endif // DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE
#endif // LED_MATRIX_KEYREACTIVE_ENABLED
# endif // DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE
#endif // LED_MATRIX_KEYREACTIVE_ENABLED

View File

@ -26,5 +26,5 @@ bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { return effect_runner_re
# endif
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE)
#endif // LED_MATRIX_KEYREACTIVE_ENABLED
# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE)
#endif // LED_MATRIX_KEYREACTIVE_ENABLED

View File

@ -26,5 +26,5 @@ bool SOLID_MULTISPLASH(effect_params_t* params) { return effect_runner_reactive_
# endif
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
# endif // !defined(DISABLE_LED_MATRIX_SPLASH) && !defined(DISABLE_LED_MATRIX_MULTISPLASH)
#endif // LED_MATRIX_KEYREACTIVE_ENABLED
# endif // !defined(DISABLE_LED_MATRIX_SPLASH) && !defined(DISABLE_LED_MATRIX_MULTISPLASH)
#endif // LED_MATRIX_KEYREACTIVE_ENABLED

View File

@ -7,4 +7,4 @@ static uint8_t WAVE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { retu
bool WAVE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &WAVE_LEFT_RIGHT_math); }
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT
#endif // DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT

View File

@ -7,4 +7,4 @@ static uint8_t WAVE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { return
bool WAVE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &WAVE_UP_DOWN_math); }
# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_LED_MATRIX_WAVE_UP_DOWN
#endif // DISABLE_LED_MATRIX_WAVE_UP_DOWN

View File

@ -42,19 +42,14 @@ const led_point_t k_led_matrix_center = LED_MATRIX_CENTER;
// clang-format on
// Generic effect runners
#include "led_matrix_runners/effect_runner_dx_dy_dist.h"
#include "led_matrix_runners/effect_runner_dx_dy.h"
#include "led_matrix_runners/effect_runner_i.h"
#include "led_matrix_runners/effect_runner_sin_cos_i.h"
#include "led_matrix_runners/effect_runner_reactive.h"
#include "led_matrix_runners/effect_runner_reactive_splash.h"
#include "led_matrix_runners.inc"
// ------------------------------------------
// -----Begin led effect includes macros-----
#define LED_MATRIX_EFFECT(name)
#define LED_MATRIX_CUSTOM_EFFECT_IMPLS
#include "led_matrix_animations/led_matrix_effects.inc"
#include "led_matrix_effects.inc"
#ifdef LED_MATRIX_CUSTOM_KB
# include "led_matrix_kb.inc"
#endif
@ -325,7 +320,7 @@ static void led_task_render(uint8_t effect) {
case LED_MATRIX_##name: \
rendering = name(&led_effect_params); \
break;
#include "led_matrix_animations/led_matrix_effects.inc"
#include "led_matrix_effects.inc"
#undef LED_MATRIX_EFFECT
#if defined(LED_MATRIX_CUSTOM_KB) || defined(LED_MATRIX_CUSTOM_USER)

View File

@ -56,7 +56,7 @@ enum led_matrix_effects {
// --------------------------------------
// -----Begin led effect enum macros-----
#define LED_MATRIX_EFFECT(name, ...) LED_MATRIX_##name,
#include "led_matrix_animations/led_matrix_effects.inc"
#include "led_matrix_effects.inc"
#undef LED_MATRIX_EFFECT
#if defined(LED_MATRIX_CUSTOM_KB) || defined(LED_MATRIX_CUSTOM_USER)

Some files were not shown because too many files have changed in this diff Show More