diff options
| author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-10 18:55:02 -0500 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-10 16:55:02 -0700 |
| commit | 62ba66d61821fec6a5ad3bdccdf738e15e082461 (patch) | |
| tree | 4b0fb100299a7a7e9a51cbbe96da94df8a57483f | |
| parent | febaf9dec42ce4d4ade316f811145a291137ee94 (diff) | |
| download | qmk_firmware-62ba66d61821fec6a5ad3bdccdf738e15e082461.tar.gz qmk_firmware-62ba66d61821fec6a5ad3bdccdf738e15e082461.zip | |
Cleanup/rgb matrix (#5811)
* clean up rgb matrix extern usage
Moved rgb matrix boiler plate into macros
Rebased onto typing heatmap pr
* Fixing the reversed frame buffer access in digital rain
* Fixing digital rain & typing heatmap if keyreactive effects are not enabled
* Apply suggestions from code review
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Adding parenthesizes to DRIVER_LED_TOTAL where necessary
* Updated docs
* added notes about parentheses
48 files changed, 222 insertions, 442 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 1e4341467..e29433a4b 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
| @@ -30,9 +30,11 @@ Configure the hardware via your `config.h`: | |||
| 30 | #define DRIVER_COUNT 2 | 30 | #define DRIVER_COUNT 2 |
| 31 | #define DRIVER_1_LED_TOTAL 25 | 31 | #define DRIVER_1_LED_TOTAL 25 |
| 32 | #define DRIVER_2_LED_TOTAL 24 | 32 | #define DRIVER_2_LED_TOTAL 24 |
| 33 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | 33 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) |
| 34 | ``` | 34 | ``` |
| 35 | 35 | ||
| 36 | !> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. | ||
| 37 | |||
| 36 | Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. | 38 | Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. |
| 37 | 39 | ||
| 38 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 40 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c index 650c178a7..e4f56f5a8 100644 --- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -32,7 +31,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 32 | 31 | ||
| 33 | }; | 32 | }; |
| 34 | 33 | ||
| 35 | extern led_config_t g_led_config; | ||
| 36 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 34 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 37 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 35 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 38 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 36 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c index 80741b19c..04c31bab1 100644 --- a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -53,7 +52,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 53 | 52 | ||
| 54 | 53 | ||
| 55 | 54 | ||
| 56 | extern led_config_t g_led_config; | ||
| 57 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 55 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 58 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 56 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 59 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 57 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c index 584f035ef..8633b1836 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -38,7 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 38 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 37 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 39 | }; | 38 | }; |
| 40 | 39 | ||
| 41 | extern led_config_t g_led_config; | ||
| 42 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 40 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 43 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 41 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 44 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 42 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c index c0bc1b89b..464d92e02 100644 --- a/keyboards/dztech/dz60rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/default/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c index 5a7a56801..091343ac3 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -39,7 +38,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 39 | }; | 38 | }; |
| 40 | 39 | ||
| 41 | 40 | ||
| 42 | extern led_config_t g_led_config; | ||
| 43 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 41 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 44 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 42 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 45 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 43 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c index 34c1752ff..bc8a6fa36 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -39,7 +38,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 39 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS), | 38 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS), |
| 40 | }; | 39 | }; |
| 41 | 40 | ||
| 42 | extern led_config_t g_led_config; | ||
| 43 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 41 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 44 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 42 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 45 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 43 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c index 3a90d2f33..61a3a2286 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -38,7 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 38 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 37 | KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 39 | }; | 38 | }; |
| 40 | 39 | ||
| 41 | extern led_config_t g_led_config; | ||
| 42 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 40 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 43 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 41 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 44 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 42 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c index 5c725f5dc..600ac8619 100644 --- a/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/matthewrobo/keymap.c | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | 2 | ||
| 3 | extern bool g_suspend_state; | ||
| 4 | 3 | ||
| 5 | enum dz60rgb_layers { | 4 | enum dz60rgb_layers { |
| 6 | _QWERTY, | 5 | _QWERTY, |
| @@ -26,7 +25,6 @@ enum dz60rgb_keycodes { | |||
| 26 | #define _V_V_V_ KC_TRNS | 25 | #define _V_V_V_ KC_TRNS |
| 27 | #define LT_CAPS LT(_NAV, KC_CAPS) | 26 | #define LT_CAPS LT(_NAV, KC_CAPS) |
| 28 | #define LT_DEL LT(_RGB, KC_DEL) | 27 | #define LT_DEL LT(_RGB, KC_DEL) |
| 29 | extern rgb_config_t rgb_matrix_config; | ||
| 30 | extern bool autoshift_enabled; | 28 | extern bool autoshift_enabled; |
| 31 | #define MT_SLSH RSFT_T(KC_SLSH) | 29 | #define MT_SLSH RSFT_T(KC_SLSH) |
| 32 | #define MT_APP RALT_T(KC_APP) | 30 | #define MT_APP RALT_T(KC_APP) |
diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index a6d1e226b..a7f1dd73e 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | #define _LAYER2 2 | 4 | #define _LAYER2 2 |
| @@ -50,8 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 50 | 49 | ||
| 51 | 50 | ||
| 52 | 51 | ||
| 53 | extern led_config_t g_led_config; | 52 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { |
| 54 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | ||
| 55 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 53 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 56 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 54 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
| 57 | rgb_matrix_set_color( i, red, green, blue ); | 55 | rgb_matrix_set_color( i, red, green, blue ); |
diff --git a/keyboards/dztech/dz65rgb/config.h b/keyboards/dztech/dz65rgb/config.h index 8ef9c2390..f4c1f1114 100644 --- a/keyboards/dztech/dz65rgb/config.h +++ b/keyboards/dztech/dz65rgb/config.h | |||
| @@ -26,4 +26,4 @@ | |||
| 26 | #define DRIVER_COUNT 2 | 26 | #define DRIVER_COUNT 2 |
| 27 | #define DRIVER_1_LED_TOTAL 35 | 27 | #define DRIVER_1_LED_TOTAL 35 |
| 28 | #define DRIVER_2_LED_TOTAL 33 | 28 | #define DRIVER_2_LED_TOTAL 33 |
| 29 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | 29 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) |
diff --git a/keyboards/dztech/dz65rgb/keymaps/default/keymap.c b/keyboards/dztech/dz65rgb/keymaps/default/keymap.c index bce9118f8..dae08a48c 100644 --- a/keyboards/dztech/dz65rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz65rgb/keymaps/default/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | #define _LAYER0 0 | 2 | #define _LAYER0 0 |
| 4 | #define _LAYER1 1 | 3 | #define _LAYER1 1 |
| 5 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 4 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index cbf7f8aaa..d22836bd8 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h | |||
| @@ -107,7 +107,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 107 | #define DRIVER_COUNT 2 | 107 | #define DRIVER_COUNT 2 |
| 108 | #define DRIVER_1_LED_TOTAL 24 | 108 | #define DRIVER_1_LED_TOTAL 24 |
| 109 | #define DRIVER_2_LED_TOTAL 24 | 109 | #define DRIVER_2_LED_TOTAL 24 |
| 110 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | 110 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) |
| 111 | 111 | ||
| 112 | // #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF | 112 | // #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF |
| 113 | /* #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF */ | 113 | /* #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF */ |
diff --git a/keyboards/hs60/v1/config.h b/keyboards/hs60/v1/config.h index 528f08bb9..ee546f3f1 100644 --- a/keyboards/hs60/v1/config.h +++ b/keyboards/hs60/v1/config.h | |||
| @@ -134,4 +134,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 134 | #define DRIVER_2_LED_TOTAL 32 | 134 | #define DRIVER_2_LED_TOTAL 32 |
| 135 | #endif | 135 | #endif |
| 136 | 136 | ||
| 137 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | 137 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) |
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c index b4339a4d4..2823292e6 100644 --- a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | extern bool g_suspend_state; | ||
| 3 | 2 | ||
| 4 | enum ctrl_layers { | 3 | enum ctrl_layers { |
| 5 | _QWERTY, | 4 | _QWERTY, |
| @@ -31,7 +30,6 @@ enum ctrl_keycodes { | |||
| 31 | #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode | 30 | #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode |
| 32 | #define LT_CAPS LT(_NAV, KC_CAPS) | 31 | #define LT_CAPS LT(_NAV, KC_CAPS) |
| 33 | #define _V_V_V_ KC_TRNS | 32 | #define _V_V_V_ KC_TRNS |
| 34 | extern rgb_config_t rgb_matrix_config; | ||
| 35 | extern bool autoshift_enabled; | 33 | extern bool autoshift_enabled; |
| 36 | 34 | ||
| 37 | 35 | ||
diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c index 0ffff4e69..e6a1411ee 100644 --- a/keyboards/planck/keymaps/tom/keymap.c +++ b/keyboards/planck/keymaps/tom/keymap.c | |||
| @@ -224,10 +224,6 @@ bool music_mask_user(uint16_t keycode) { | |||
| 224 | } | 224 | } |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | #ifdef RGB_MATRIX_ENABLE | ||
| 228 | extern led_config_t g_led_config; | ||
| 229 | #endif | ||
| 230 | |||
| 231 | void rgb_matrix_indicators_user(void) { | 227 | void rgb_matrix_indicators_user(void) { |
| 232 | #ifdef RGB_MATRIX_ENABLE | 228 | #ifdef RGB_MATRIX_ENABLE |
| 233 | switch (biton32(layer_state)) { | 229 | switch (biton32(layer_state)) { |
diff --git a/keyboards/planck/light/config.h b/keyboards/planck/light/config.h index 17c015ed0..c7bc9cb1a 100644 --- a/keyboards/planck/light/config.h +++ b/keyboards/planck/light/config.h | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | #define DRIVER_COUNT 2 | 39 | #define DRIVER_COUNT 2 |
| 40 | #define DRIVER_1_LED_TOTAL 25 | 40 | #define DRIVER_1_LED_TOTAL 25 |
| 41 | #define DRIVER_2_LED_TOTAL 24 | 41 | #define DRIVER_2_LED_TOTAL 24 |
| 42 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | 42 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | #endif | 45 | #endif |
diff --git a/keyboards/sol/keymaps/xulkal/keymap.c b/keyboards/sol/keymaps/xulkal/keymap.c index 111e8aa32..3bbd57f70 100644 --- a/keyboards/sol/keymaps/xulkal/keymap.c +++ b/keyboards/sol/keymaps/xulkal/keymap.c | |||
| @@ -92,7 +92,6 @@ static void render_logo(void) { | |||
| 92 | oled_write_P(sol_logo, false); | 92 | oled_write_P(sol_logo, false); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | extern rgb_config_t rgb_matrix_config; | ||
| 96 | 95 | ||
| 97 | static void render_status(void) { | 96 | static void render_status(void) { |
| 98 | // Render to mode icon | 97 | // Render to mode icon |
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 3cfce966b..08689cf3d 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -24,10 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 24 | # define UC(x) KC_NO | 24 | # define UC(x) KC_NO |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #ifdef RGB_MATRIX_ENABLE | ||
| 28 | extern bool g_suspend_state; | ||
| 29 | extern rgb_config_t rgb_matrix_config; | ||
| 30 | #endif | ||
| 31 | extern userspace_config_t userspace_config; | 27 | extern userspace_config_t userspace_config; |
| 32 | 28 | ||
| 33 | enum more_custom_keycodes { | 29 | enum more_custom_keycodes { |
| @@ -403,7 +399,6 @@ void suspend_wakeup_init_keymap(void) { | |||
| 403 | rgb_matrix_set_suspend_state(false); | 399 | rgb_matrix_set_suspend_state(false); |
| 404 | } | 400 | } |
| 405 | 401 | ||
| 406 | extern led_config_t g_led_config; | ||
| 407 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 402 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { |
| 408 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 403 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 409 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 404 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index e8dc185a1..9b0c2d794 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
| @@ -17,10 +17,6 @@ | |||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | #include "drashna.h" | 18 | #include "drashna.h" |
| 19 | 19 | ||
| 20 | #ifdef RGB_MATRIX_ENABLE | ||
| 21 | extern bool g_suspend_state; | ||
| 22 | extern rgb_config_t rgb_matrix_config; | ||
| 23 | #endif | ||
| 24 | #ifdef RGBLIGHT_ENABLE | 20 | #ifdef RGBLIGHT_ENABLE |
| 25 | extern rgblight_config_t rgblight_config; | 21 | extern rgblight_config_t rgblight_config; |
| 26 | #endif | 22 | #endif |
| @@ -184,7 +180,6 @@ void suspend_wakeup_init_keymap(void) { | |||
| 184 | rgb_matrix_set_suspend_state(false); | 180 | rgb_matrix_set_suspend_state(false); |
| 185 | } | 181 | } |
| 186 | 182 | ||
| 187 | extern led_config_t g_led_config; | ||
| 188 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { | 183 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { |
| 189 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 184 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 190 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { | 185 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { |
diff --git a/quantum/quantum.c b/quantum/quantum.c index d4fa7f2ef..473ead65f 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -258,7 +258,7 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 258 | #ifdef HAPTIC_ENABLE | 258 | #ifdef HAPTIC_ENABLE |
| 259 | process_haptic(keycode, record) && | 259 | process_haptic(keycode, record) && |
| 260 | #endif //HAPTIC_ENABLE | 260 | #endif //HAPTIC_ENABLE |
| 261 | #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_KEYREACTIVE_ENABLED) | 261 | #if defined(RGB_MATRIX_ENABLE) |
| 262 | process_rgb_matrix(keycode, record) && | 262 | process_rgb_matrix(keycode, record) && |
| 263 | #endif | 263 | #endif |
| 264 | process_record_kb(keycode, record) && | 264 | process_record_kb(keycode, record) && |
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 92a94df80..9b9932df5 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
| @@ -26,41 +26,23 @@ | |||
| 26 | 26 | ||
| 27 | #include "lib/lib8tion/lib8tion.h" | 27 | #include "lib/lib8tion/lib8tion.h" |
| 28 | 28 | ||
| 29 | #include "rgb_matrix_animations/solid_color_anim.h" | 29 | // ------------------------------------------ |
| 30 | #include "rgb_matrix_animations/alpha_mods_anim.h" | 30 | // -----Begin rgb effect includes macros----- |
| 31 | #include "rgb_matrix_animations/dual_beacon_anim.h" | 31 | #define RGB_MATRIX_EFFECT(name) |
| 32 | #include "rgb_matrix_animations/gradient_up_down_anim.h" | 32 | #define RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
| 33 | #include "rgb_matrix_animations/raindrops_anim.h" | ||
| 34 | #include "rgb_matrix_animations/cycle_all_anim.h" | ||
| 35 | #include "rgb_matrix_animations/cycle_left_right_anim.h" | ||
| 36 | #include "rgb_matrix_animations/cycle_up_down_anim.h" | ||
| 37 | #include "rgb_matrix_animations/rainbow_beacon_anim.h" | ||
| 38 | #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" | ||
| 39 | #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" | ||
| 40 | #include "rgb_matrix_animations/jellybean_raindrops_anim.h" | ||
| 41 | #include "rgb_matrix_animations/typing_heatmap_anim.h" | ||
| 42 | #include "rgb_matrix_animations/digital_rain_anim.h" | ||
| 43 | #include "rgb_matrix_animations/solid_reactive_simple_anim.h" | ||
| 44 | #include "rgb_matrix_animations/solid_reactive_anim.h" | ||
| 45 | #include "rgb_matrix_animations/solid_reactive_wide.h" | ||
| 46 | #include "rgb_matrix_animations/solid_reactive_cross.h" | ||
| 47 | #include "rgb_matrix_animations/solid_reactive_nexus.h" | ||
| 48 | #include "rgb_matrix_animations/splash_anim.h" | ||
| 49 | #include "rgb_matrix_animations/solid_splash_anim.h" | ||
| 50 | #include "rgb_matrix_animations/breathing_anim.h" | ||
| 51 | 33 | ||
| 52 | #if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) | 34 | #include "rgb_matrix_animations/rgb_matrix_effects.inc" |
| 53 | #define RGB_MATRIX_CUSTOM_EFFECT_IMPLS | 35 | #ifdef RGB_MATRIX_CUSTOM_KB |
| 54 | #define RGB_MATRIX_EFFECT(name, ...) | 36 | #include "rgb_matrix_kb.inc" |
| 55 | #ifdef RGB_MATRIX_CUSTOM_KB | ||
| 56 | #include "rgb_matrix_kb.inc" | ||
| 57 | #endif | ||
| 58 | #ifdef RGB_MATRIX_CUSTOM_USER | ||
| 59 | #include "rgb_matrix_user.inc" | ||
| 60 | #endif | ||
| 61 | #undef RGB_MATRIX_EFFECT | ||
| 62 | #undef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 63 | #endif | 37 | #endif |
| 38 | #ifdef RGB_MATRIX_CUSTOM_USER | ||
| 39 | #include "rgb_matrix_user.inc" | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #undef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 43 | #undef RGB_MATRIX_EFFECT | ||
| 44 | // -----End rgb effect includes macros------- | ||
| 45 | // ------------------------------------------ | ||
| 64 | 46 | ||
| 65 | #ifndef RGB_DISABLE_AFTER_TIMEOUT | 47 | #ifndef RGB_DISABLE_AFTER_TIMEOUT |
| 66 | #define RGB_DISABLE_AFTER_TIMEOUT 0 | 48 | #define RGB_DISABLE_AFTER_TIMEOUT 0 |
| @@ -106,7 +88,6 @@ | |||
| 106 | 88 | ||
| 107 | bool g_suspend_state = false; | 89 | bool g_suspend_state = false; |
| 108 | 90 | ||
| 109 | extern led_config_t g_led_config; | ||
| 110 | rgb_config_t rgb_matrix_config; | 91 | rgb_config_t rgb_matrix_config; |
| 111 | 92 | ||
| 112 | rgb_counters_t g_rgb_counters; | 93 | rgb_counters_t g_rgb_counters; |
| @@ -319,145 +300,14 @@ static void rgb_task_render(uint8_t effect) { | |||
| 319 | rendering = rgb_matrix_none(&rgb_effect_params); | 300 | rendering = rgb_matrix_none(&rgb_effect_params); |
| 320 | break; | 301 | break; |
| 321 | 302 | ||
| 322 | case RGB_MATRIX_SOLID_COLOR: | 303 | // --------------------------------------------- |
| 323 | rendering = rgb_matrix_solid_color(&rgb_effect_params); // Max 1ms Avg 0ms | 304 | // -----Begin rgb effect switch case macros----- |
| 324 | break; | 305 | #define RGB_MATRIX_EFFECT(name, ...) \ |
| 325 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS | 306 | case RGB_MATRIX_##name: \ |
| 326 | case RGB_MATRIX_ALPHAS_MODS: | 307 | rendering = name(&rgb_effect_params); \ |
| 327 | rendering = rgb_matrix_alphas_mods(&rgb_effect_params); // Max 2ms Avg 1ms | ||
| 328 | break; | ||
| 329 | #endif // DISABLE_RGB_MATRIX_ALPHAS_MODS | ||
| 330 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 331 | case RGB_MATRIX_GRADIENT_UP_DOWN: | ||
| 332 | rendering = rgb_matrix_gradient_up_down(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 333 | break; | ||
| 334 | #endif // DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 335 | #ifndef DISABLE_RGB_MATRIX_BREATHING | ||
| 336 | case RGB_MATRIX_BREATHING: | ||
| 337 | rendering = rgb_matrix_breathing(&rgb_effect_params); // Max 1ms Avg 0ms | ||
| 338 | break; | ||
| 339 | #endif // DISABLE_RGB_MATRIX_BREATHING | ||
| 340 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 341 | case RGB_MATRIX_CYCLE_ALL: | ||
| 342 | rendering = rgb_matrix_cycle_all(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 343 | break; | ||
| 344 | #endif // DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 345 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 346 | case RGB_MATRIX_CYCLE_LEFT_RIGHT: | ||
| 347 | rendering = rgb_matrix_cycle_left_right(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 348 | break; | ||
| 349 | #endif // DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 350 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 351 | case RGB_MATRIX_CYCLE_UP_DOWN: | ||
| 352 | rendering = rgb_matrix_cycle_up_down(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 353 | break; | ||
| 354 | #endif // DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 355 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 356 | case RGB_MATRIX_RAINBOW_MOVING_CHEVRON: | ||
| 357 | rendering = rgb_matrix_rainbow_moving_chevron(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 358 | break; | ||
| 359 | #endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 360 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 361 | case RGB_MATRIX_DUAL_BEACON: | ||
| 362 | rendering = rgb_matrix_dual_beacon(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 363 | break; | ||
| 364 | #endif // DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 365 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 366 | case RGB_MATRIX_RAINBOW_BEACON: | ||
| 367 | rendering = rgb_matrix_rainbow_beacon(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 368 | break; | ||
| 369 | #endif // DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 370 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 371 | case RGB_MATRIX_RAINBOW_PINWHEELS: | ||
| 372 | rendering = rgb_matrix_rainbow_pinwheels(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 373 | break; | ||
| 374 | #endif // DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 375 | #ifndef DISABLE_RGB_MATRIX_RAINDROPS | ||
| 376 | case RGB_MATRIX_RAINDROPS: | ||
| 377 | rendering = rgb_matrix_raindrops(&rgb_effect_params); // Max 1ms Avg 0ms | ||
| 378 | break; | ||
| 379 | #endif // DISABLE_RGB_MATRIX_RAINDROPS | ||
| 380 | #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 381 | case RGB_MATRIX_JELLYBEAN_RAINDROPS: | ||
| 382 | rendering = rgb_matrix_jellybean_raindrops(&rgb_effect_params); // Max 1ms Avg 0ms | ||
| 383 | break; | ||
| 384 | #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 385 | |||
| 386 | #ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 387 | #ifndef DISABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 388 | case RGB_MATRIX_TYPING_HEATMAP: | ||
| 389 | rendering = rgb_matrix_typing_heatmap(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 390 | break; | ||
| 391 | #endif // DISABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 392 | #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 393 | case RGB_MATRIX_DIGITAL_RAIN: | ||
| 394 | rendering = rgb_matrix_digital_rain(&rgb_effect_params); // Max 9ms Avg 8ms | this is expensive, fix it | ||
| 395 | break; | ||
| 396 | #endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 397 | #endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 398 | |||
| 399 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | ||
| 400 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 401 | case RGB_MATRIX_SOLID_REACTIVE_SIMPLE: | ||
| 402 | rendering = rgb_matrix_solid_reactive_simple(&rgb_effect_params);// Max 4ms Avg 3ms | ||
| 403 | break; | ||
| 404 | #endif | ||
| 405 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 406 | case RGB_MATRIX_SOLID_REACTIVE: | ||
| 407 | rendering = rgb_matrix_solid_reactive(&rgb_effect_params); // Max 4ms Avg 3ms | ||
| 408 | break; | ||
| 409 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 410 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 411 | case RGB_MATRIX_SOLID_REACTIVE_WIDE: | ||
| 412 | rendering = rgb_matrix_solid_reactive_wide(&rgb_effect_params); // Max ?? ms Avg ?? ms | ||
| 413 | break; | ||
| 414 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 415 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 416 | case RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE: | ||
| 417 | rendering = rgb_matrix_solid_reactive_multiwide(&rgb_effect_params); // Max ?? ms Avg ?? ms | ||
| 418 | break; | ||
| 419 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 420 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 421 | case RGB_MATRIX_SOLID_REACTIVE_CROSS: | ||
| 422 | rendering = rgb_matrix_solid_reactive_cross(&rgb_effect_params); // Max ?? ms Avg ?? ms | ||
| 423 | break; | ||
| 424 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 425 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 426 | case RGB_MATRIX_SOLID_REACTIVE_MULTICROSS: | ||
| 427 | rendering = rgb_matrix_solid_reactive_multicross(&rgb_effect_params); // Max ?? ms Avg ?? ms | ||
| 428 | break; | ||
| 429 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 430 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 431 | case RGB_MATRIX_SOLID_REACTIVE_NEXUS: | ||
| 432 | rendering = rgb_matrix_solid_reactive_nexus(&rgb_effect_params); // Max ?? ms Avg ?? ms | ||
| 433 | break; | ||
| 434 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 435 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 436 | case RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS: | ||
| 437 | rendering = rgb_matrix_solid_reactive_multinexus(&rgb_effect_params); // Max ?? ms Avg ?? ms | ||
| 438 | break; | ||
| 439 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 440 | #ifndef DISABLE_RGB_MATRIX_SPLASH | ||
| 441 | case RGB_MATRIX_SPLASH: | ||
| 442 | rendering = rgb_matrix_splash(&rgb_effect_params); // Max 5ms Avg 3ms | ||
| 443 | break; | ||
| 444 | #endif // DISABLE_RGB_MATRIX_SPLASH | ||
| 445 | #ifndef DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 446 | case RGB_MATRIX_MULTISPLASH: | ||
| 447 | rendering = rgb_matrix_multisplash(&rgb_effect_params); // Max 10ms Avg 5ms | ||
| 448 | break; | ||
| 449 | #endif // DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 450 | #ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 451 | case RGB_MATRIX_SOLID_SPLASH: | ||
| 452 | rendering = rgb_matrix_solid_splash(&rgb_effect_params); // Max 5ms Avg 3ms | ||
| 453 | break; | ||
| 454 | #endif // DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 455 | #ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 456 | case RGB_MATRIX_SOLID_MULTISPLASH: | ||
| 457 | rendering = rgb_matrix_solid_multisplash(&rgb_effect_params); // Max 10ms Avg 5ms | ||
| 458 | break; | 308 | break; |
| 459 | #endif // DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | 309 | #include "rgb_matrix_animations/rgb_matrix_effects.inc" |
| 460 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 310 | #undef RGB_MATRIX_EFFECT |
| 461 | 311 | ||
| 462 | #if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) | 312 | #if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) |
| 463 | #define RGB_MATRIX_EFFECT(name, ...) \ | 313 | #define RGB_MATRIX_EFFECT(name, ...) \ |
| @@ -472,6 +322,8 @@ static void rgb_task_render(uint8_t effect) { | |||
| 472 | #endif | 322 | #endif |
| 473 | #undef RGB_MATRIX_EFFECT | 323 | #undef RGB_MATRIX_EFFECT |
| 474 | #endif | 324 | #endif |
| 325 | // -----End rgb effect switch case macros------- | ||
| 326 | // --------------------------------------------- | ||
| 475 | 327 | ||
| 476 | // Factory default magic value | 328 | // Factory default magic value |
| 477 | case UINT8_MAX: { | 329 | case UINT8_MAX: { |
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index add0715d9..96a8b7662 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h | |||
| @@ -64,89 +64,12 @@ typedef struct | |||
| 64 | 64 | ||
| 65 | enum rgb_matrix_effects { | 65 | enum rgb_matrix_effects { |
| 66 | RGB_MATRIX_NONE = 0, | 66 | RGB_MATRIX_NONE = 0, |
| 67 | RGB_MATRIX_SOLID_COLOR = 1, | 67 | |
| 68 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS | 68 | // -------------------------------------- |
| 69 | RGB_MATRIX_ALPHAS_MODS, | 69 | // -----Begin rgb effect enum macros----- |
| 70 | #endif // DISABLE_RGB_MATRIX_ALPHAS_MODS | 70 | #define RGB_MATRIX_EFFECT(name, ...) RGB_MATRIX_##name, |
| 71 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | 71 | #include "rgb_matrix_animations/rgb_matrix_effects.inc" |
| 72 | RGB_MATRIX_GRADIENT_UP_DOWN, | 72 | #undef RGB_MATRIX_EFFECT |
| 73 | #endif // DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 74 | #ifndef DISABLE_RGB_MATRIX_BREATHING | ||
| 75 | RGB_MATRIX_BREATHING, | ||
| 76 | #endif // DISABLE_RGB_MATRIX_BREATHING | ||
| 77 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 78 | RGB_MATRIX_CYCLE_ALL, | ||
| 79 | #endif // DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 80 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 81 | RGB_MATRIX_CYCLE_LEFT_RIGHT, | ||
| 82 | #endif // DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 83 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 84 | RGB_MATRIX_CYCLE_UP_DOWN, | ||
| 85 | #endif // DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 86 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 87 | RGB_MATRIX_RAINBOW_MOVING_CHEVRON, | ||
| 88 | #endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 89 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 90 | RGB_MATRIX_DUAL_BEACON, | ||
| 91 | #endif // DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 92 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 93 | RGB_MATRIX_RAINBOW_BEACON, | ||
| 94 | #endif // DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 95 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 96 | RGB_MATRIX_RAINBOW_PINWHEELS, | ||
| 97 | #endif // DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 98 | #ifndef DISABLE_RGB_MATRIX_RAINDROPS | ||
| 99 | RGB_MATRIX_RAINDROPS, | ||
| 100 | #endif // DISABLE_RGB_MATRIX_RAINDROPS | ||
| 101 | #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 102 | RGB_MATRIX_JELLYBEAN_RAINDROPS, | ||
| 103 | #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 104 | #ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 105 | #ifndef DISABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 106 | RGB_MATRIX_TYPING_HEATMAP, | ||
| 107 | #endif // DISABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 108 | #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 109 | RGB_MATRIX_DIGITAL_RAIN, | ||
| 110 | #endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 111 | #endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 112 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | ||
| 113 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 114 | RGB_MATRIX_SOLID_REACTIVE_SIMPLE, | ||
| 115 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 116 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 117 | RGB_MATRIX_SOLID_REACTIVE, | ||
| 118 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 119 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 120 | RGB_MATRIX_SOLID_REACTIVE_WIDE, | ||
| 121 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 122 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 123 | RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE, | ||
| 124 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 125 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 126 | RGB_MATRIX_SOLID_REACTIVE_CROSS, | ||
| 127 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 128 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 129 | RGB_MATRIX_SOLID_REACTIVE_MULTICROSS, | ||
| 130 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 131 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 132 | RGB_MATRIX_SOLID_REACTIVE_NEXUS, | ||
| 133 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 134 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 135 | RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS, | ||
| 136 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 137 | #ifndef DISABLE_RGB_MATRIX_SPLASH | ||
| 138 | RGB_MATRIX_SPLASH, | ||
| 139 | #endif // DISABLE_RGB_MATRIX_SPLASH | ||
| 140 | #ifndef DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 141 | RGB_MATRIX_MULTISPLASH, | ||
| 142 | #endif // DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 143 | #ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 144 | RGB_MATRIX_SOLID_SPLASH, | ||
| 145 | #endif // DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 146 | #ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 147 | RGB_MATRIX_SOLID_MULTISPLASH, | ||
| 148 | #endif // DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 149 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | ||
| 150 | 73 | ||
| 151 | #if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) | 74 | #if defined(RGB_MATRIX_CUSTOM_KB) || defined(RGB_MATRIX_CUSTOM_USER) |
| 152 | #define RGB_MATRIX_EFFECT(name, ...) RGB_MATRIX_CUSTOM_##name, | 75 | #define RGB_MATRIX_EFFECT(name, ...) RGB_MATRIX_CUSTOM_##name, |
| @@ -158,6 +81,8 @@ enum rgb_matrix_effects { | |||
| 158 | #endif | 81 | #endif |
| 159 | #undef RGB_MATRIX_EFFECT | 82 | #undef RGB_MATRIX_EFFECT |
| 160 | #endif | 83 | #endif |
| 84 | // -------------------------------------- | ||
| 85 | // -----End rgb effect enum macros------- | ||
| 161 | 86 | ||
| 162 | RGB_MATRIX_EFFECT_MAX | 87 | RGB_MATRIX_EFFECT_MAX |
| 163 | }; | 88 | }; |
| @@ -257,4 +182,16 @@ typedef struct { | |||
| 257 | 182 | ||
| 258 | extern const rgb_matrix_driver_t rgb_matrix_driver; | 183 | extern const rgb_matrix_driver_t rgb_matrix_driver; |
| 259 | 184 | ||
| 185 | extern rgb_config_t rgb_matrix_config; | ||
| 186 | |||
| 187 | extern bool g_suspend_state; | ||
| 188 | extern rgb_counters_t g_rgb_counters; | ||
| 189 | extern led_config_t g_led_config; | ||
| 190 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | ||
| 191 | extern last_hit_t g_last_hit_tracker; | ||
| 192 | #endif | ||
| 193 | #ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 194 | extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; | ||
| 195 | #endif | ||
| 196 | |||
| 260 | #endif | 197 | #endif |
diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h index d7f6f4655..0fee19aef 100644 --- a/quantum/rgb_matrix_animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h | |||
| @@ -1,11 +1,9 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS | 1 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS |
| 3 | 2 | RGB_MATRIX_EFFECT(ALPHAS_MODS) | |
| 4 | extern led_config_t g_led_config; | 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
| 5 | extern rgb_config_t rgb_matrix_config; | ||
| 6 | 4 | ||
| 7 | // alphas = color1, mods = color2 | 5 | // alphas = color1, mods = color2 |
| 8 | bool rgb_matrix_alphas_mods(effect_params_t* params) { | 6 | bool ALPHAS_MODS(effect_params_t* params) { |
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 7 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 8 | ||
| 11 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; | 9 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -24,4 +22,5 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) { | |||
| 24 | return led_max < DRIVER_LED_TOTAL; | 22 | return led_max < DRIVER_LED_TOTAL; |
| 25 | } | 23 | } |
| 26 | 24 | ||
| 25 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 27 | #endif // DISABLE_RGB_MATRIX_ALPHAS_MODS | 26 | #endif // DISABLE_RGB_MATRIX_ALPHAS_MODS |
diff --git a/quantum/rgb_matrix_animations/breathing_anim.h b/quantum/rgb_matrix_animations/breathing_anim.h index 54d60f927..c357b5303 100644 --- a/quantum/rgb_matrix_animations/breathing_anim.h +++ b/quantum/rgb_matrix_animations/breathing_anim.h | |||
| @@ -1,10 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_BREATHING | 1 | #ifndef DISABLE_RGB_MATRIX_BREATHING |
| 2 | RGB_MATRIX_EFFECT(BREATHING) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool BREATHING(effect_params_t* params) { |
| 5 | extern rgb_config_t rgb_matrix_config; | ||
| 6 | |||
| 7 | bool rgb_matrix_breathing(effect_params_t* params) { | ||
| 8 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 9 | 7 | ||
| 10 | uint16_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 8); | 8 | uint16_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 8); |
| @@ -18,4 +16,5 @@ bool rgb_matrix_breathing(effect_params_t* params) { | |||
| 18 | return led_max < DRIVER_LED_TOTAL; | 16 | return led_max < DRIVER_LED_TOTAL; |
| 19 | } | 17 | } |
| 20 | 18 | ||
| 19 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 21 | #endif // DISABLE_RGB_MATRIX_BREATHING | 20 | #endif // DISABLE_RGB_MATRIX_BREATHING |
diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index e93798f90..e6319cad7 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL | 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL |
| 2 | RGB_MATRIX_EFFECT(CYCLE_ALL) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool CYCLE_ALL(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_cycle_all(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -18,4 +15,5 @@ bool rgb_matrix_cycle_all(effect_params_t* params) { | |||
| 18 | return led_max < DRIVER_LED_TOTAL; | 15 | return led_max < DRIVER_LED_TOTAL; |
| 19 | } | 16 | } |
| 20 | 17 | ||
| 18 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 21 | #endif // DISABLE_RGB_MATRIX_CYCLE_ALL | 19 | #endif // DISABLE_RGB_MATRIX_CYCLE_ALL |
diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h index 4b09d5826..d9a00530a 100644 --- a/quantum/rgb_matrix_animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT |
| 2 | RGB_MATRIX_EFFECT(CYCLE_LEFT_RIGHT) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool CYCLE_LEFT_RIGHT(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_cycle_left_right(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -19,4 +16,5 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) { | |||
| 19 | return led_max < DRIVER_LED_TOTAL; | 16 | return led_max < DRIVER_LED_TOTAL; |
| 20 | } | 17 | } |
| 21 | 18 | ||
| 19 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 22 | #endif // DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | 20 | #endif // DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT |
diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h index 403214bb7..f2b31d9da 100644 --- a/quantum/rgb_matrix_animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN |
| 2 | RGB_MATRIX_EFFECT(CYCLE_UP_DOWN) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool CYCLE_UP_DOWN(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_cycle_up_down(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -19,4 +16,5 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) { | |||
| 19 | return led_max < DRIVER_LED_TOTAL; | 16 | return led_max < DRIVER_LED_TOTAL; |
| 20 | } | 17 | } |
| 21 | 18 | ||
| 19 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 22 | #endif // DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | 20 | #endif // DISABLE_RGB_MATRIX_CYCLE_UP_DOWN |
diff --git a/quantum/rgb_matrix_animations/digital_rain_anim.h b/quantum/rgb_matrix_animations/digital_rain_anim.h index 6ccba392a..982399cbd 100644 --- a/quantum/rgb_matrix_animations/digital_rain_anim.h +++ b/quantum/rgb_matrix_animations/digital_rain_anim.h | |||
| @@ -1,14 +1,13 @@ | |||
| 1 | #pragma once | ||
| 2 | #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) | 1 | #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) |
| 2 | RGB_MATRIX_EFFECT(DIGITAL_RAIN) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | #ifndef RGB_DIGITAL_RAIN_DROPS | 5 | #ifndef RGB_DIGITAL_RAIN_DROPS |
| 5 | // lower the number for denser effect/wider keyboard | 6 | // lower the number for denser effect/wider keyboard |
| 6 | #define RGB_DIGITAL_RAIN_DROPS 24 | 7 | #define RGB_DIGITAL_RAIN_DROPS 24 |
| 7 | #endif | 8 | #endif |
| 8 | 9 | ||
| 9 | extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; | 10 | bool DIGITAL_RAIN(effect_params_t* params) { |
| 10 | |||
| 11 | bool rgb_matrix_digital_rain(effect_params_t* params) { | ||
| 12 | // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain | 11 | // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain |
| 13 | const uint8_t drop_ticks = 28; | 12 | const uint8_t drop_ticks = 28; |
| 14 | const uint8_t pure_green_intensity = 0xd0; | 13 | const uint8_t pure_green_intensity = 0xd0; |
| @@ -19,7 +18,7 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { | |||
| 19 | 18 | ||
| 20 | if (params->init) { | 19 | if (params->init) { |
| 21 | rgb_matrix_set_color_all(0, 0, 0); | 20 | rgb_matrix_set_color_all(0, 0, 0); |
| 22 | memset(rgb_frame_buffer, 0, sizeof rgb_frame_buffer); | 21 | memset(rgb_frame_buffer, 0, sizeof(rgb_frame_buffer)); |
| 23 | drop = 0; | 22 | drop = 0; |
| 24 | } | 23 | } |
| 25 | 24 | ||
| @@ -28,11 +27,11 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { | |||
| 28 | if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { | 27 | if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { |
| 29 | // top row, pixels have just fallen and we're | 28 | // top row, pixels have just fallen and we're |
| 30 | // making a new rain drop in this column | 29 | // making a new rain drop in this column |
| 31 | rgb_frame_buffer[col][row] = max_intensity; | 30 | rgb_frame_buffer[row][col] = max_intensity; |
| 32 | } | 31 | } |
| 33 | else if (rgb_frame_buffer[col][row] > 0 && rgb_frame_buffer[col][row] < max_intensity) { | 32 | else if (rgb_frame_buffer[row][col] > 0 && rgb_frame_buffer[row][col] < max_intensity) { |
| 34 | // neither fully bright nor dark, decay it | 33 | // neither fully bright nor dark, decay it |
| 35 | rgb_frame_buffer[col][row]--; | 34 | rgb_frame_buffer[row][col]--; |
| 36 | } | 35 | } |
| 37 | // set the pixel colour | 36 | // set the pixel colour |
| 38 | uint8_t led[LED_HITS_TO_REMEMBER]; | 37 | uint8_t led[LED_HITS_TO_REMEMBER]; |
| @@ -40,12 +39,12 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { | |||
| 40 | 39 | ||
| 41 | // TODO: multiple leds are supported mapped to the same row/column | 40 | // TODO: multiple leds are supported mapped to the same row/column |
| 42 | if (led_count > 0) { | 41 | if (led_count > 0) { |
| 43 | if (rgb_frame_buffer[col][row] > pure_green_intensity) { | 42 | if (rgb_frame_buffer[row][col] > pure_green_intensity) { |
| 44 | const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (rgb_frame_buffer[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); | 43 | const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity)); |
| 45 | rgb_matrix_set_color(led[0], boost, max_intensity, boost); | 44 | rgb_matrix_set_color(led[0], boost, max_intensity, boost); |
| 46 | } | 45 | } |
| 47 | else { | 46 | else { |
| 48 | const uint8_t green = (uint8_t) ((uint16_t) max_intensity * rgb_frame_buffer[col][row] / pure_green_intensity); | 47 | const uint8_t green = (uint8_t) ((uint16_t) max_intensity * rgb_frame_buffer[row][col] / pure_green_intensity); |
| 49 | rgb_matrix_set_color(led[0], 0, green, 0); | 48 | rgb_matrix_set_color(led[0], 0, green, 0); |
| 50 | } | 49 | } |
| 51 | } | 50 | } |
| @@ -58,15 +57,15 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { | |||
| 58 | for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { | 57 | for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { |
| 59 | for (uint8_t col = 0; col < MATRIX_COLS; col++) { | 58 | for (uint8_t col = 0; col < MATRIX_COLS; col++) { |
| 60 | // if ths is on the bottom row and bright allow decay | 59 | // if ths is on the bottom row and bright allow decay |
| 61 | if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[col][row] == max_intensity) { | 60 | if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[row][col] == max_intensity) { |
| 62 | rgb_frame_buffer[col][row]--; | 61 | rgb_frame_buffer[row][col]--; |
| 63 | } | 62 | } |
| 64 | // check if the pixel above is bright | 63 | // check if the pixel above is bright |
| 65 | if (rgb_frame_buffer[col][row - 1] == max_intensity) { | 64 | if (rgb_frame_buffer[row - 1][col] == max_intensity) { |
| 66 | // allow old bright pixel to decay | 65 | // allow old bright pixel to decay |
| 67 | rgb_frame_buffer[col][row - 1]--; | 66 | rgb_frame_buffer[row - 1][col]--; |
| 68 | // make this pixel bright | 67 | // make this pixel bright |
| 69 | rgb_frame_buffer[col][row] = max_intensity; | 68 | rgb_frame_buffer[row][col] = max_intensity; |
| 70 | } | 69 | } |
| 71 | } | 70 | } |
| 72 | } | 71 | } |
| @@ -74,4 +73,5 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { | |||
| 74 | return false; | 73 | return false; |
| 75 | } | 74 | } |
| 76 | 75 | ||
| 76 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 77 | #endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) | 77 | #endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) |
diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h index dcb594029..f853f71ec 100644 --- a/quantum/rgb_matrix_animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON | 1 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON |
| 2 | RGB_MATRIX_EFFECT(DUAL_BEACON) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool DUAL_BEACON(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_dual_beacon(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -21,4 +18,5 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) { | |||
| 21 | return led_max < DRIVER_LED_TOTAL; | 18 | return led_max < DRIVER_LED_TOTAL; |
| 22 | } | 19 | } |
| 23 | 20 | ||
| 21 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 24 | #endif // DISABLE_RGB_MATRIX_DUAL_BEACON | 22 | #endif // DISABLE_RGB_MATRIX_DUAL_BEACON |
diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h index 7a6ed1421..d9fcd4d98 100644 --- a/quantum/rgb_matrix_animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h | |||
| @@ -1,10 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | 1 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN |
| 2 | RGB_MATRIX_EFFECT(GRADIENT_UP_DOWN) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern led_config_t g_led_config; | 5 | bool GRADIENT_UP_DOWN(effect_params_t* params) { |
| 5 | extern rgb_config_t rgb_matrix_config; | ||
| 6 | |||
| 7 | bool rgb_matrix_gradient_up_down(effect_params_t* params) { | ||
| 8 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 9 | 7 | ||
| 10 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -19,4 +17,6 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) { | |||
| 19 | } | 17 | } |
| 20 | return led_max < DRIVER_LED_TOTAL; | 18 | return led_max < DRIVER_LED_TOTAL; |
| 21 | } | 19 | } |
| 20 | |||
| 21 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 22 | #endif // DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | 22 | #endif // DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN |
diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index 5ea971435..8f0b1bd91 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h | |||
| @@ -1,9 +1,6 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | 1 | #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS |
| 3 | 2 | RGB_MATRIX_EFFECT(JELLYBEAN_RAINDROPS) | |
| 4 | extern rgb_counters_t g_rgb_counters; | 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | 4 | ||
| 8 | static void jellybean_raindrops_set_color(int i, effect_params_t* params) { | 5 | static void jellybean_raindrops_set_color(int i, effect_params_t* params) { |
| 9 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; | 6 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; |
| @@ -12,7 +9,7 @@ static void jellybean_raindrops_set_color(int i, effect_params_t* params) { | |||
| 12 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 9 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
| 13 | } | 10 | } |
| 14 | 11 | ||
| 15 | bool rgb_matrix_jellybean_raindrops(effect_params_t* params) { | 12 | bool JELLYBEAN_RAINDROPS(effect_params_t* params) { |
| 16 | if (!params->init) { | 13 | if (!params->init) { |
| 17 | // Change one LED every tick, make sure speed is not 0 | 14 | // Change one LED every tick, make sure speed is not 0 |
| 18 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { | 15 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { |
| @@ -28,4 +25,5 @@ bool rgb_matrix_jellybean_raindrops(effect_params_t* params) { | |||
| 28 | return led_max < DRIVER_LED_TOTAL; | 25 | return led_max < DRIVER_LED_TOTAL; |
| 29 | } | 26 | } |
| 30 | 27 | ||
| 28 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 31 | #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | 29 | #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS |
diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h index d46288073..a0e0f814c 100644 --- a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON | 1 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON |
| 2 | RGB_MATRIX_EFFECT(RAINBOW_BEACON) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool RAINBOW_BEACON(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_rainbow_beacon(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -21,4 +18,5 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) { | |||
| 21 | return led_max < DRIVER_LED_TOTAL; | 18 | return led_max < DRIVER_LED_TOTAL; |
| 22 | } | 19 | } |
| 23 | 20 | ||
| 21 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 24 | #endif // DISABLE_RGB_MATRIX_RAINBOW_BEACON | 22 | #endif // DISABLE_RGB_MATRIX_RAINBOW_BEACON |
diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h index 3b7d9689f..39352b0c1 100644 --- a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | 1 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON |
| 2 | RGB_MATRIX_EFFECT(RAINBOW_MOVING_CHEVRON) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool RAINBOW_MOVING_CHEVRON(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -19,4 +16,5 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { | |||
| 19 | return led_max < DRIVER_LED_TOTAL; | 16 | return led_max < DRIVER_LED_TOTAL; |
| 20 | } | 17 | } |
| 21 | 18 | ||
| 19 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 22 | #endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | 20 | #endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON |
diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h index e92f35176..275aaa48d 100644 --- a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | 1 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS |
| 2 | RGB_MATRIX_EFFECT(PINWHEELS) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 3 | 4 | ||
| 4 | extern rgb_counters_t g_rgb_counters; | 5 | bool PINWHEELS(effect_params_t* params) { |
| 5 | extern led_config_t g_led_config; | ||
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | |||
| 8 | bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { | ||
| 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 10 | 7 | ||
| 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -21,4 +18,5 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { | |||
| 21 | return led_max < DRIVER_LED_TOTAL; | 18 | return led_max < DRIVER_LED_TOTAL; |
| 22 | } | 19 | } |
| 23 | 20 | ||
| 21 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 24 | #endif // DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | 22 | #endif // DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS |
diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index 4ce1d65e5..09d0d1df8 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h | |||
| @@ -1,10 +1,6 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifndef DISABLE_RGB_MATRIX_RAINDROPS | 1 | #ifndef DISABLE_RGB_MATRIX_RAINDROPS |
| 3 | #include "rgb_matrix_types.h" | 2 | RGB_MATRIX_EFFECT(RAINDROPS) |
| 4 | 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | |
| 5 | extern rgb_counters_t g_rgb_counters; | ||
| 6 | extern led_config_t g_led_config; | ||
| 7 | extern rgb_config_t rgb_matrix_config; | ||
| 8 | 4 | ||
| 9 | static void raindrops_set_color(int i, effect_params_t* params) { | 5 | static void raindrops_set_color(int i, effect_params_t* params) { |
| 10 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; | 6 | if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; |
| @@ -23,7 +19,7 @@ static void raindrops_set_color(int i, effect_params_t* params) { | |||
| 23 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 19 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
| 24 | } | 20 | } |
| 25 | 21 | ||
| 26 | bool rgb_matrix_raindrops(effect_params_t* params) { | 22 | bool RAINDROPS(effect_params_t* params) { |
| 27 | if (!params->init) { | 23 | if (!params->init) { |
| 28 | // Change one LED every tick, make sure speed is not 0 | 24 | // Change one LED every tick, make sure speed is not 0 |
| 29 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { | 25 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { |
| @@ -39,4 +35,5 @@ bool rgb_matrix_raindrops(effect_params_t* params) { | |||
| 39 | return led_max < DRIVER_LED_TOTAL; | 35 | return led_max < DRIVER_LED_TOTAL; |
| 40 | } | 36 | } |
| 41 | 37 | ||
| 38 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 42 | #endif // DISABLE_RGB_MATRIX_RAINDROPS | 39 | #endif // DISABLE_RGB_MATRIX_RAINDROPS |
diff --git a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc new file mode 100644 index 000000000..9bc645461 --- /dev/null +++ b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // Add your new core rgb matrix effect here, order determins enum order, requires "rgb_matrix_animations/ directory | ||
| 2 | #include "rgb_matrix_animations/solid_color_anim.h" | ||
| 3 | #include "rgb_matrix_animations/alpha_mods_anim.h" | ||
| 4 | #include "rgb_matrix_animations/gradient_up_down_anim.h" | ||
| 5 | #include "rgb_matrix_animations/breathing_anim.h" | ||
| 6 | #include "rgb_matrix_animations/cycle_all_anim.h" | ||
| 7 | #include "rgb_matrix_animations/cycle_left_right_anim.h" | ||
| 8 | #include "rgb_matrix_animations/cycle_up_down_anim.h" | ||
| 9 | #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" | ||
| 10 | #include "rgb_matrix_animations/dual_beacon_anim.h" | ||
| 11 | #include "rgb_matrix_animations/rainbow_beacon_anim.h" | ||
| 12 | #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" | ||
| 13 | #include "rgb_matrix_animations/raindrops_anim.h" | ||
| 14 | #include "rgb_matrix_animations/jellybean_raindrops_anim.h" | ||
| 15 | #include "rgb_matrix_animations/typing_heatmap_anim.h" | ||
| 16 | #include "rgb_matrix_animations/digital_rain_anim.h" | ||
| 17 | #include "rgb_matrix_animations/solid_reactive_simple_anim.h" | ||
| 18 | #include "rgb_matrix_animations/solid_reactive_anim.h" | ||
| 19 | #include "rgb_matrix_animations/solid_reactive_wide.h" | ||
| 20 | #include "rgb_matrix_animations/solid_reactive_cross.h" | ||
| 21 | #include "rgb_matrix_animations/solid_reactive_nexus.h" | ||
| 22 | #include "rgb_matrix_animations/splash_anim.h" | ||
| 23 | #include "rgb_matrix_animations/solid_splash_anim.h" | ||
diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h index ba2cea15e..937642559 100644 --- a/quantum/rgb_matrix_animations/solid_color_anim.h +++ b/quantum/rgb_matrix_animations/solid_color_anim.h | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | #pragma once | 1 | RGB_MATRIX_EFFECT(SOLID_COLOR) |
| 2 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 2 | 3 | ||
| 3 | extern led_config_t g_led_config; | 4 | bool SOLID_COLOR(effect_params_t* params) { |
| 4 | extern rgb_config_t rgb_matrix_config; | ||
| 5 | |||
| 6 | bool rgb_matrix_solid_color(effect_params_t* params) { | ||
| 7 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 5 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 8 | 6 | ||
| 9 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; | 7 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; |
| @@ -14,3 +12,5 @@ bool rgb_matrix_solid_color(effect_params_t* params) { | |||
| 14 | } | 12 | } |
| 15 | return led_max < DRIVER_LED_TOTAL; | 13 | return led_max < DRIVER_LED_TOTAL; |
| 16 | } | 14 | } |
| 15 | |||
| 16 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index c3dba8a5a..37e339907 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h | |||
| @@ -1,12 +1,9 @@ | |||
| 1 | #pragma once | 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 2 | #if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) | ||
| 3 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE | 2 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE |
| 3 | RGB_MATRIX_EFFECT(SOLID_REACTIVE) | ||
| 4 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 4 | 5 | ||
| 5 | extern led_config_t g_led_config; | 6 | bool SOLID_REACTIVE(effect_params_t* params) { |
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | extern last_hit_t g_last_hit_tracker; | ||
| 8 | |||
| 9 | bool rgb_matrix_solid_reactive(effect_params_t* params) { | ||
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 7 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 11 | 8 | ||
| 12 | HSV hsv = { rgb_matrix_config.hue, 255, rgb_matrix_config.val }; | 9 | HSV hsv = { rgb_matrix_config.hue, 255, rgb_matrix_config.val }; |
| @@ -32,5 +29,6 @@ bool rgb_matrix_solid_reactive(effect_params_t* params) { | |||
| 32 | return led_max < DRIVER_LED_TOTAL; | 29 | return led_max < DRIVER_LED_TOTAL; |
| 33 | } | 30 | } |
| 34 | 31 | ||
| 35 | #endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | 32 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
| 36 | #endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) | 33 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE |
| 34 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | ||
diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h index 8858f71e6..62210f82d 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h | |||
| @@ -1,10 +1,15 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) | 2 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) |
| 4 | 3 | ||
| 5 | extern led_config_t g_led_config; | 4 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS |
| 6 | extern rgb_config_t rgb_matrix_config; | 5 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_CROSS) |
| 7 | extern last_hit_t g_last_hit_tracker; | 6 | #endif |
| 7 | |||
| 8 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 9 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTICROSS) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 8 | 13 | ||
| 9 | static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_params_t* params) { | 14 | static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_params_t* params) { |
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 15 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| @@ -38,13 +43,14 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par | |||
| 38 | return led_max < DRIVER_LED_TOTAL; | 43 | return led_max < DRIVER_LED_TOTAL; |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 41 | bool rgb_matrix_solid_reactive_multicross(effect_params_t* params) { | 46 | bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { |
| 42 | return rgb_matrix_solid_reactive_multicross_range(0, params); | 47 | return rgb_matrix_solid_reactive_multicross_range(0, params); |
| 43 | } | 48 | } |
| 44 | 49 | ||
| 45 | bool rgb_matrix_solid_reactive_cross(effect_params_t* params) { | 50 | bool SOLID_REACTIVE_CROSS(effect_params_t* params) { |
| 46 | return rgb_matrix_solid_reactive_multicross_range(qsub8(g_last_hit_tracker.count, 1), params); | 51 | return rgb_matrix_solid_reactive_multicross_range(qsub8(g_last_hit_tracker.count, 1), params); |
| 47 | } | 52 | } |
| 48 | 53 | ||
| 54 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 49 | #endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) | 55 | #endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) |
| 50 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 56 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index c0e3c2450..33f478ac7 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h | |||
| @@ -1,10 +1,15 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) | 2 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) |
| 4 | 3 | ||
| 5 | extern led_config_t g_led_config; | 4 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS |
| 6 | extern rgb_config_t rgb_matrix_config; | 5 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS) |
| 7 | extern last_hit_t g_last_hit_tracker; | 6 | #endif |
| 7 | |||
| 8 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 9 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 8 | 13 | ||
| 9 | static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_params_t* params) { | 14 | static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_params_t* params) { |
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 15 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| @@ -36,13 +41,14 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par | |||
| 36 | return led_max < DRIVER_LED_TOTAL; | 41 | return led_max < DRIVER_LED_TOTAL; |
| 37 | } | 42 | } |
| 38 | 43 | ||
| 39 | bool rgb_matrix_solid_reactive_multinexus(effect_params_t* params) { | 44 | bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { |
| 40 | return rgb_matrix_solid_reactive_multinexus_range(0, params); | 45 | return rgb_matrix_solid_reactive_multinexus_range(0, params); |
| 41 | } | 46 | } |
| 42 | 47 | ||
| 43 | bool rgb_matrix_solid_reactive_nexus(effect_params_t* params) { | 48 | bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { |
| 44 | return rgb_matrix_solid_reactive_multinexus_range(qsub8(g_last_hit_tracker.count, 1), params); | 49 | return rgb_matrix_solid_reactive_multinexus_range(qsub8(g_last_hit_tracker.count, 1), params); |
| 45 | } | 50 | } |
| 46 | 51 | ||
| 52 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 47 | #endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) | 53 | #endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) |
| 48 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 54 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index abc7e36a8..a568a5438 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h | |||
| @@ -1,12 +1,10 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | 3 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE |
| 4 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) | ||
| 5 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 4 | 6 | ||
| 5 | extern led_config_t g_led_config; | 7 | bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { |
| 6 | extern rgb_config_t rgb_matrix_config; | ||
| 7 | extern last_hit_t g_last_hit_tracker; | ||
| 8 | |||
| 9 | bool rgb_matrix_solid_reactive_simple(effect_params_t* params) { | ||
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 8 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| 11 | 9 | ||
| 12 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; | 10 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; |
| @@ -31,5 +29,6 @@ bool rgb_matrix_solid_reactive_simple(effect_params_t* params) { | |||
| 31 | return led_max < DRIVER_LED_TOTAL; | 29 | return led_max < DRIVER_LED_TOTAL; |
| 32 | } | 30 | } |
| 33 | 31 | ||
| 32 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 34 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | 33 | #endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE |
| 35 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 34 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h index 3d1d38e80..ff0f6f5ec 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h | |||
| @@ -1,10 +1,15 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) | 2 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) |
| 4 | 3 | ||
| 5 | extern led_config_t g_led_config; | 4 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE |
| 6 | extern rgb_config_t rgb_matrix_config; | 5 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE) |
| 7 | extern last_hit_t g_last_hit_tracker; | 6 | #endif |
| 7 | |||
| 8 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 9 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 8 | 13 | ||
| 9 | static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_params_t* params) { | 14 | static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_params_t* params) { |
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 15 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| @@ -30,13 +35,14 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para | |||
| 30 | return led_max < DRIVER_LED_TOTAL; | 35 | return led_max < DRIVER_LED_TOTAL; |
| 31 | } | 36 | } |
| 32 | 37 | ||
| 33 | bool rgb_matrix_solid_reactive_multiwide(effect_params_t* params) { | 38 | bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { |
| 34 | return rgb_matrix_solid_reactive_multiwide_range(0, params); | 39 | return rgb_matrix_solid_reactive_multiwide_range(0, params); |
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | bool rgb_matrix_solid_reactive_wide(effect_params_t* params) { | 42 | bool SOLID_REACTIVE_WIDE(effect_params_t* params) { |
| 38 | return rgb_matrix_solid_reactive_multiwide_range(qsub8(g_last_hit_tracker.count, 1), params); | 43 | return rgb_matrix_solid_reactive_multiwide_range(qsub8(g_last_hit_tracker.count, 1), params); |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 46 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 41 | #endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) | 47 | #endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) |
| 42 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 48 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h index 4e5565d0d..d439bd888 100644 --- a/quantum/rgb_matrix_animations/solid_splash_anim.h +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h | |||
| @@ -1,10 +1,15 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) | 2 | #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) |
| 4 | 3 | ||
| 5 | extern led_config_t g_led_config; | 4 | #ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH |
| 6 | extern rgb_config_t rgb_matrix_config; | 5 | RGB_MATRIX_EFFECT(SOLID_SPLASH) |
| 7 | extern last_hit_t g_last_hit_tracker; | 6 | #endif |
| 7 | |||
| 8 | #ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 9 | RGB_MATRIX_EFFECT(SOLID_MULTISPLASH) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 8 | 13 | ||
| 9 | static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* params) { | 14 | static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* params) { |
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 15 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| @@ -30,13 +35,14 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p | |||
| 30 | return led_max < DRIVER_LED_TOTAL; | 35 | return led_max < DRIVER_LED_TOTAL; |
| 31 | } | 36 | } |
| 32 | 37 | ||
| 33 | bool rgb_matrix_solid_multisplash(effect_params_t* params) { | 38 | bool SOLID_MULTISPLASH(effect_params_t* params) { |
| 34 | return rgb_matrix_solid_multisplash_range(0, params); | 39 | return rgb_matrix_solid_multisplash_range(0, params); |
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | bool rgb_matrix_solid_splash(effect_params_t* params) { | 42 | bool SOLID_SPLASH(effect_params_t* params) { |
| 38 | return rgb_matrix_solid_multisplash_range(qsub8(g_last_hit_tracker.count, 1), params); | 43 | return rgb_matrix_solid_multisplash_range(qsub8(g_last_hit_tracker.count, 1), params); |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 46 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 41 | #endif // !defined(DISABLE_RGB_MATRIX_SPLASH) && !defined(DISABLE_RGB_MATRIX_MULTISPLASH) | 47 | #endif // !defined(DISABLE_RGB_MATRIX_SPLASH) && !defined(DISABLE_RGB_MATRIX_MULTISPLASH) |
| 42 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 48 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h index fbe776111..214dab68d 100644 --- a/quantum/rgb_matrix_animations/splash_anim.h +++ b/quantum/rgb_matrix_animations/splash_anim.h | |||
| @@ -1,10 +1,16 @@ | |||
| 1 | #pragma once | ||
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) | 2 | #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) |
| 4 | 3 | ||
| 5 | extern led_config_t g_led_config; | 4 | #ifndef DISABLE_RGB_MATRIX_SPLASH |
| 6 | extern rgb_config_t rgb_matrix_config; | 5 | RGB_MATRIX_EFFECT(SPLASH) |
| 7 | extern last_hit_t g_last_hit_tracker; | 6 | #endif |
| 7 | |||
| 8 | #ifndef DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 9 | RGB_MATRIX_EFFECT(MULTISPLASH) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 13 | |||
| 8 | 14 | ||
| 9 | static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) { | 15 | static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) { |
| 10 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 16 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
| @@ -32,13 +38,14 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) | |||
| 32 | return led_max < DRIVER_LED_TOTAL; | 38 | return led_max < DRIVER_LED_TOTAL; |
| 33 | } | 39 | } |
| 34 | 40 | ||
| 35 | bool rgb_matrix_multisplash(effect_params_t* params) { | 41 | bool MULTISPLASH(effect_params_t* params) { |
| 36 | return rgb_matrix_multisplash_range(0, params); | 42 | return rgb_matrix_multisplash_range(0, params); |
| 37 | } | 43 | } |
| 38 | 44 | ||
| 39 | bool rgb_matrix_splash(effect_params_t* params) { | 45 | bool SPLASH(effect_params_t* params) { |
| 40 | return rgb_matrix_multisplash_range(qsub8(g_last_hit_tracker.count, 1), params); | 46 | return rgb_matrix_multisplash_range(qsub8(g_last_hit_tracker.count, 1), params); |
| 41 | } | 47 | } |
| 42 | 48 | ||
| 49 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 43 | #endif // !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) | 50 | #endif // !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) |
| 44 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 51 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
diff --git a/quantum/rgb_matrix_animations/typing_heatmap_anim.h b/quantum/rgb_matrix_animations/typing_heatmap_anim.h index aade53fcc..e6b34717b 100644 --- a/quantum/rgb_matrix_animations/typing_heatmap_anim.h +++ b/quantum/rgb_matrix_animations/typing_heatmap_anim.h | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | #pragma once | ||
| 2 | #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) | 1 | #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) |
| 3 | 2 | RGB_MATRIX_EFFECT(TYPING_HEATMAP) | |
| 4 | extern rgb_config_t rgb_matrix_config; | 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS |
| 5 | extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; | ||
| 6 | 4 | ||
| 7 | void process_rgb_matrix_typing_heatmap(keyrecord_t *record) { | 5 | void process_rgb_matrix_typing_heatmap(keyrecord_t *record) { |
| 8 | uint8_t row = record->event.key.row; | 6 | uint8_t row = record->event.key.row; |
| @@ -35,7 +33,7 @@ void process_rgb_matrix_typing_heatmap(keyrecord_t *record) { | |||
| 35 | } | 33 | } |
| 36 | } | 34 | } |
| 37 | 35 | ||
| 38 | bool rgb_matrix_typing_heatmap(effect_params_t* params) { | 36 | bool TYPING_HEATMAP(effect_params_t* params) { |
| 39 | // Modified version of RGB_MATRIX_USE_LIMITS to work off of matrix row / col size | 37 | // Modified version of RGB_MATRIX_USE_LIMITS to work off of matrix row / col size |
| 40 | uint8_t led_min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; | 38 | uint8_t led_min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; |
| 41 | uint8_t led_max = led_min + RGB_MATRIX_LED_PROCESS_LIMIT; | 39 | uint8_t led_max = led_min + RGB_MATRIX_LED_PROCESS_LIMIT; |
| @@ -72,4 +70,5 @@ bool rgb_matrix_typing_heatmap(effect_params_t* params) { | |||
| 72 | return led_max < sizeof(rgb_frame_buffer); | 70 | return led_max < sizeof(rgb_frame_buffer); |
| 73 | } | 71 | } |
| 74 | 72 | ||
| 73 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 75 | #endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) | 74 | #endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) |
diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index ea067a743..42dfccbc5 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c | |||
| @@ -27,8 +27,6 @@ led_instruction_t led_instructions[] = { { .end = 1 } }; | |||
| 27 | static void led_matrix_massdrop_config_override(int i); | 27 | static void led_matrix_massdrop_config_override(int i); |
| 28 | #endif // USE_MASSDROP_CONFIGURATOR | 28 | #endif // USE_MASSDROP_CONFIGURATOR |
| 29 | 29 | ||
| 30 | extern rgb_config_t rgb_matrix_config; | ||
| 31 | extern rgb_counters_t g_rgb_counters; | ||
| 32 | 30 | ||
| 33 | void SERCOM1_0_Handler( void ) | 31 | void SERCOM1_0_Handler( void ) |
| 34 | { | 32 | { |
| @@ -431,7 +429,6 @@ static void led_run_pattern(led_setup_t *f, float* ro, float* go, float* bo, flo | |||
| 431 | } | 429 | } |
| 432 | } | 430 | } |
| 433 | 431 | ||
| 434 | extern led_config_t g_led_config; | ||
| 435 | static void led_matrix_massdrop_config_override(int i) | 432 | static void led_matrix_massdrop_config_override(int i) |
| 436 | { | 433 | { |
| 437 | float ro = 0; | 434 | float ro = 0; |
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 38e86ae0e..9e19747fa 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | #if defined(RGBLIGHT_ENABLE) | 5 | #if defined(RGBLIGHT_ENABLE) |
| 6 | extern rgblight_config_t rgblight_config; | 6 | extern rgblight_config_t rgblight_config; |
| 7 | bool has_initialized; | 7 | bool has_initialized; |
| 8 | #elif defined(RGB_MATRIX_ENABLE) | ||
| 9 | extern rgb_config_t rgb_matrix_config; | ||
| 10 | #endif | 8 | #endif |
| 11 | 9 | ||
| 12 | #ifdef RGBLIGHT_ENABLE | 10 | #ifdef RGBLIGHT_ENABLE |
