diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-07 21:17:00 -0500 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-05-07 19:17:00 -0700 |
commit | 60eae7335b711e8d4be7d48ad2290141e04debe7 (patch) | |
tree | 667801cbaf17d3e6694509ee5ede765defc8f47c /quantum/rgb_matrix.c | |
parent | af89752bffbaf5dcea30ea16be66b4d682701bc4 (diff) | |
download | qmk_firmware-60eae7335b711e8d4be7d48ad2290141e04debe7.tar.gz qmk_firmware-60eae7335b711e8d4be7d48ad2290141e04debe7.zip |
RGB Matrix Typing Heatmap (#5786)
* RGB Matrix Typing Heatmap Effect
* Fixing file name and effect init
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r-- | quantum/rgb_matrix.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index edbcee9cd..92a94df80 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" | 38 | #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" |
39 | #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" | 39 | #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" |
40 | #include "rgb_matrix_animations/jellybean_raindrops_anim.h" | 40 | #include "rgb_matrix_animations/jellybean_raindrops_anim.h" |
41 | #include "rgb_matrix_animations/typing_heatmap_anim.h" | ||
41 | #include "rgb_matrix_animations/digital_rain_anim.h" | 42 | #include "rgb_matrix_animations/digital_rain_anim.h" |
42 | #include "rgb_matrix_animations/solid_reactive_simple_anim.h" | 43 | #include "rgb_matrix_animations/solid_reactive_simple_anim.h" |
43 | #include "rgb_matrix_animations/solid_reactive_anim.h" | 44 | #include "rgb_matrix_animations/solid_reactive_anim.h" |
@@ -111,6 +112,10 @@ rgb_config_t rgb_matrix_config; | |||
111 | rgb_counters_t g_rgb_counters; | 112 | rgb_counters_t g_rgb_counters; |
112 | static uint32_t rgb_counters_buffer; | 113 | static uint32_t rgb_counters_buffer; |
113 | 114 | ||
115 | #ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
116 | uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS] = {{0}}; | ||
117 | #endif | ||
118 | |||
114 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 119 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
115 | last_hit_t g_last_hit_tracker; | 120 | last_hit_t g_last_hit_tracker; |
116 | static last_hit_t last_hit_buffer; | 121 | static last_hit_t last_hit_buffer; |
@@ -206,6 +211,13 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { | |||
206 | last_hit_buffer.count++; | 211 | last_hit_buffer.count++; |
207 | } | 212 | } |
208 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | 213 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED |
214 | |||
215 | #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) | ||
216 | if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { | ||
217 | process_rgb_matrix_typing_heatmap(record); | ||
218 | } | ||
219 | #endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) | ||
220 | |||
209 | return true; | 221 | return true; |
210 | } | 222 | } |
211 | 223 | ||
@@ -370,11 +382,20 @@ static void rgb_task_render(uint8_t effect) { | |||
370 | rendering = rgb_matrix_jellybean_raindrops(&rgb_effect_params); // Max 1ms Avg 0ms | 382 | rendering = rgb_matrix_jellybean_raindrops(&rgb_effect_params); // Max 1ms Avg 0ms |
371 | break; | 383 | break; |
372 | #endif // DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | 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 | ||
373 | #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN | 392 | #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN |
374 | case RGB_MATRIX_DIGITAL_RAIN: | 393 | case RGB_MATRIX_DIGITAL_RAIN: |
375 | rendering = rgb_matrix_digital_rain(&rgb_effect_params); // Max 9ms Avg 8ms | this is expensive, fix it | 394 | rendering = rgb_matrix_digital_rain(&rgb_effect_params); // Max 9ms Avg 8ms | this is expensive, fix it |
376 | break; | 395 | break; |
377 | #endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN | 396 | #endif // DISABLE_RGB_MATRIX_DIGITAL_RAIN |
397 | #endif // RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
398 | |||
378 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 399 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
379 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | 400 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE |
380 | case RGB_MATRIX_SOLID_REACTIVE_SIMPLE: | 401 | case RGB_MATRIX_SOLID_REACTIVE_SIMPLE: |