diff options
Diffstat (limited to 'quantum/rgb_matrix_animations')
5 files changed, 29 insertions, 29 deletions
diff --git a/quantum/rgb_matrix_animations/breathing_anim.h b/quantum/rgb_matrix_animations/breathing_anim.h index 92431555e7..887425f9da 100644 --- a/quantum/rgb_matrix_animations/breathing_anim.h +++ b/quantum/rgb_matrix_animations/breathing_anim.h @@ -6,7 +6,7 @@ bool BREATHING(effect_params_t* params) { RGB_MATRIX_USE_LIMITS(led_min, led_max); HSV hsv = rgb_matrix_config.hsv; - uint16_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 8); + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); RGB rgb = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { diff --git a/quantum/rgb_matrix_animations/digital_rain_anim.h b/quantum/rgb_matrix_animations/digital_rain_anim.h index 7a4a52db1b..1de45f8e8d 100644 --- a/quantum/rgb_matrix_animations/digital_rain_anim.h +++ b/quantum/rgb_matrix_animations/digital_rain_anim.h @@ -18,7 +18,7 @@ bool DIGITAL_RAIN(effect_params_t* params) { if (params->init) { rgb_matrix_set_color_all(0, 0, 0); - memset(rgb_frame_buffer, 0, sizeof(rgb_frame_buffer)); + memset(g_rgb_frame_buffer, 0, sizeof(g_rgb_frame_buffer)); drop = 0; } @@ -27,10 +27,10 @@ bool DIGITAL_RAIN(effect_params_t* params) { if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { // top row, pixels have just fallen and we're // making a new rain drop in this column - rgb_frame_buffer[row][col] = max_intensity; - } else if (rgb_frame_buffer[row][col] > 0 && rgb_frame_buffer[row][col] < max_intensity) { + g_rgb_frame_buffer[row][col] = max_intensity; + } else if (g_rgb_frame_buffer[row][col] > 0 && g_rgb_frame_buffer[row][col] < max_intensity) { // neither fully bright nor dark, decay it - rgb_frame_buffer[row][col]--; + g_rgb_frame_buffer[row][col]--; } // set the pixel colour uint8_t led[LED_HITS_TO_REMEMBER]; @@ -38,11 +38,11 @@ bool DIGITAL_RAIN(effect_params_t* params) { // TODO: multiple leds are supported mapped to the same row/column if (led_count > 0) { - if (rgb_frame_buffer[row][col] > pure_green_intensity) { - const uint8_t boost = (uint8_t)((uint16_t)max_brightness_boost * (rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity)); + if (g_rgb_frame_buffer[row][col] > pure_green_intensity) { + const uint8_t boost = (uint8_t)((uint16_t)max_brightness_boost * (g_rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity)); rgb_matrix_set_color(led[0], boost, max_intensity, boost); } else { - const uint8_t green = (uint8_t)((uint16_t)max_intensity * rgb_frame_buffer[row][col] / pure_green_intensity); + const uint8_t green = (uint8_t)((uint16_t)max_intensity * g_rgb_frame_buffer[row][col] / pure_green_intensity); rgb_matrix_set_color(led[0], 0, green, 0); } } @@ -55,15 +55,15 @@ bool DIGITAL_RAIN(effect_params_t* params) { for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { // if ths is on the bottom row and bright allow decay - if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[row][col] == max_intensity) { - rgb_frame_buffer[row][col]--; + if (row == MATRIX_ROWS - 1 && g_rgb_frame_buffer[row][col] == max_intensity) { + g_rgb_frame_buffer[row][col]--; } // check if the pixel above is bright - if (rgb_frame_buffer[row - 1][col] == max_intensity) { + if (g_rgb_frame_buffer[row - 1][col] == max_intensity) { // allow old bright pixel to decay - rgb_frame_buffer[row - 1][col]--; + g_rgb_frame_buffer[row - 1][col]--; // make this pixel bright - rgb_frame_buffer[row][col] = max_intensity; + g_rgb_frame_buffer[row][col] = max_intensity; } } } diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index 5596146a38..ef2d1500b0 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h @@ -12,7 +12,7 @@ static void jellybean_raindrops_set_color(int i, effect_params_t* params) { bool JELLYBEAN_RAINDROPS(effect_params_t* params) { if (!params->init) { // Change one LED every tick, make sure speed is not 0 - if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); } return false; diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index 9f839a1bce..6e1b5acb0d 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h @@ -22,7 +22,7 @@ static void raindrops_set_color(int i, effect_params_t* params) { bool RAINDROPS(effect_params_t* params) { if (!params->init) { // Change one LED every tick, make sure speed is not 0 - if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); } return false; diff --git a/quantum/rgb_matrix_animations/typing_heatmap_anim.h b/quantum/rgb_matrix_animations/typing_heatmap_anim.h index dd313f16a5..e82c1b49ee 100644 --- a/quantum/rgb_matrix_animations/typing_heatmap_anim.h +++ b/quantum/rgb_matrix_animations/typing_heatmap_anim.h @@ -10,20 +10,20 @@ void process_rgb_matrix_typing_heatmap(keyrecord_t* record) { uint8_t m_col = col - 1; uint8_t p_col = col + 1; - if (m_col < col) rgb_frame_buffer[row][m_col] = qadd8(rgb_frame_buffer[row][m_col], 16); - rgb_frame_buffer[row][col] = qadd8(rgb_frame_buffer[row][col], 32); - if (p_col < MATRIX_COLS) rgb_frame_buffer[row][p_col] = qadd8(rgb_frame_buffer[row][p_col], 16); + if (m_col < col) g_rgb_frame_buffer[row][m_col] = qadd8(g_rgb_frame_buffer[row][m_col], 16); + g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32); + if (p_col < MATRIX_COLS) g_rgb_frame_buffer[row][p_col] = qadd8(g_rgb_frame_buffer[row][p_col], 16); if (p_row < MATRIX_ROWS) { - if (m_col < col) rgb_frame_buffer[p_row][m_col] = qadd8(rgb_frame_buffer[p_row][m_col], 13); - rgb_frame_buffer[p_row][col] = qadd8(rgb_frame_buffer[p_row][col], 16); - if (p_col < MATRIX_COLS) rgb_frame_buffer[p_row][p_col] = qadd8(rgb_frame_buffer[p_row][p_col], 13); + if (m_col < col) g_rgb_frame_buffer[p_row][m_col] = qadd8(g_rgb_frame_buffer[p_row][m_col], 13); + g_rgb_frame_buffer[p_row][col] = qadd8(g_rgb_frame_buffer[p_row][col], 16); + if (p_col < MATRIX_COLS) g_rgb_frame_buffer[p_row][p_col] = qadd8(g_rgb_frame_buffer[p_row][p_col], 13); } if (m_row < row) { - if (m_col < col) rgb_frame_buffer[m_row][m_col] = qadd8(rgb_frame_buffer[m_row][m_col], 13); - rgb_frame_buffer[m_row][col] = qadd8(rgb_frame_buffer[m_row][col], 16); - if (p_col < MATRIX_COLS) rgb_frame_buffer[m_row][p_col] = qadd8(rgb_frame_buffer[m_row][p_col], 13); + if (m_col < col) g_rgb_frame_buffer[m_row][m_col] = qadd8(g_rgb_frame_buffer[m_row][m_col], 13); + g_rgb_frame_buffer[m_row][col] = qadd8(g_rgb_frame_buffer[m_row][col], 16); + if (p_col < MATRIX_COLS) g_rgb_frame_buffer[m_row][p_col] = qadd8(g_rgb_frame_buffer[m_row][p_col], 13); } } @@ -31,18 +31,18 @@ bool TYPING_HEATMAP(effect_params_t* params) { // Modified version of RGB_MATRIX_USE_LIMITS to work off of matrix row / col size uint8_t led_min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; uint8_t led_max = led_min + RGB_MATRIX_LED_PROCESS_LIMIT; - if (led_max > sizeof(rgb_frame_buffer)) led_max = sizeof(rgb_frame_buffer); + if (led_max > sizeof(g_rgb_frame_buffer)) led_max = sizeof(g_rgb_frame_buffer); if (params->init) { rgb_matrix_set_color_all(0, 0, 0); - memset(rgb_frame_buffer, 0, sizeof rgb_frame_buffer); + memset(g_rgb_frame_buffer, 0, sizeof g_rgb_frame_buffer); } // Render heatmap & decrease for (int i = led_min; i < led_max; i++) { uint8_t row = i % MATRIX_ROWS; uint8_t col = i / MATRIX_ROWS; - uint8_t val = rgb_frame_buffer[row][col]; + uint8_t val = g_rgb_frame_buffer[row][col]; // set the pixel colour uint8_t led[LED_HITS_TO_REMEMBER]; @@ -55,10 +55,10 @@ bool TYPING_HEATMAP(effect_params_t* params) { rgb_matrix_set_color(led[j], rgb.r, rgb.g, rgb.b); } - rgb_frame_buffer[row][col] = qsub8(val, 1); + g_rgb_frame_buffer[row][col] = qsub8(val, 1); } - return led_max < sizeof(rgb_frame_buffer); + return led_max < sizeof(g_rgb_frame_buffer); } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS |