mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-18 05:32:05 +00:00
Correctly handle scrolling when adjusting effect speed
This commit is contained in:
parent
ffd8acf7cc
commit
a91035ef98
@ -82,15 +82,20 @@ bool oled_task_user(void) {
|
||||
static uint8_t start_index = 0;
|
||||
|
||||
uint8_t speedPercentage = (uint8_t)(((float)rgb_matrix_get_speed() / 255.0) * 100.0);
|
||||
bool is_timer_elapsed = timer_elapsed(key_timer) > 200;
|
||||
|
||||
if (last_effect != rgb_matrix_get_mode() || last_speed != speedPercentage || timer_elapsed(key_timer) > 200) {
|
||||
if (last_effect != rgb_matrix_get_mode() || last_speed != speedPercentage || is_timer_elapsed) {
|
||||
last_effect = rgb_matrix_get_mode();
|
||||
last_speed = speedPercentage;
|
||||
key_timer = timer_read();
|
||||
|
||||
oled_write_ln_P(PSTR("Mode: "), false);
|
||||
const char *name = rgb_matrix_get_effect_name();
|
||||
if (effect_name_len > 21) {
|
||||
if (!is_timer_elapsed && start_index != 0) {
|
||||
start_index -= 1;
|
||||
} else {
|
||||
key_timer = timer_read();
|
||||
}
|
||||
if (start_index > effect_name_len) {
|
||||
start_index = 0;
|
||||
}
|
||||
@ -117,3 +122,4 @@ bool oled_task_user(void) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user