summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJasmin <98263758+chloe-the-catgirl@users.noreply.github.com>2023-04-30 03:57:30 +0200
committerGitHub <noreply@github.com>2023-04-30 11:57:30 +1000
commit4887f03dbd0b5aa3f804309a7293d2c7e632c1a7 (patch)
tree006b61d3ea74c4fa87c845d961b161576dffd364 /quantum
parenta415d2203ca9e28a77cec6a8a75e03c719eee094 (diff)
typing_heatmap: Add macro to configure increase steps (#20300)
Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgb_matrix/animations/typing_heatmap_anim.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/quantum/rgb_matrix/animations/typing_heatmap_anim.h b/quantum/rgb_matrix/animations/typing_heatmap_anim.h
index 00d137f1a6..d09bdc4631 100644
--- a/quantum/rgb_matrix/animations/typing_heatmap_anim.h
+++ b/quantum/rgb_matrix/animations/typing_heatmap_anim.h
@@ -1,6 +1,9 @@
#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && defined(ENABLE_RGB_MATRIX_TYPING_HEATMAP)
RGB_MATRIX_EFFECT(TYPING_HEATMAP)
# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
+# ifndef RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP
+# define RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP 32
+# endif
# ifndef RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS
# define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 25
@@ -16,7 +19,7 @@ RGB_MATRIX_EFFECT(TYPING_HEATMAP)
void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
# ifdef RGB_MATRIX_TYPING_HEATMAP_SLIM
// Limit effect to pressed keys
- g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32);
+ g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP);
# else
if (g_led_config.matrix_co[row][col] == NO_LED) { // skip as pressed key doesn't have an led position
return;
@@ -27,7 +30,7 @@ void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
continue;
}
if (i_row == row && i_col == col) {
- g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32);
+ g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP);
} else {
# define LED_DISTANCE(led_a, led_b) sqrt16(((int16_t)(led_a.x - led_b.x) * (int16_t)(led_a.x - led_b.x)) + ((int16_t)(led_a.y - led_b.y) * (int16_t)(led_a.y - led_b.y)))
uint8_t distance = LED_DISTANCE(g_led_config.point[g_led_config.matrix_co[row][col]], g_led_config.point[g_led_config.matrix_co[i_row][i_col]]);