mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-19 03:36:28 +00:00
rgblight: Fix rgblight_blink_layer when multiple layers are active (#16824)
This commit is contained in:
parent
fb4f25c0b5
commit
1e389c7904
1 changed files with 4 additions and 3 deletions
|
@ -829,18 +829,19 @@ void rgblight_blink_layer_repeat(uint8_t layer, uint16_t duration_ms, uint8_t ti
|
||||||
void rgblight_blink_layer_repeat_helper(void) {
|
void rgblight_blink_layer_repeat_helper(void) {
|
||||||
if (_blinking_layer_mask != 0 && timer_expired(sync_timer_read(), _repeat_timer)) {
|
if (_blinking_layer_mask != 0 && timer_expired(sync_timer_read(), _repeat_timer)) {
|
||||||
for (uint8_t layer = 0; layer < RGBLIGHT_MAX_LAYERS; layer++) {
|
for (uint8_t layer = 0; layer < RGBLIGHT_MAX_LAYERS; layer++) {
|
||||||
if ((_blinking_layer_mask & (rgblight_layer_mask_t)1 << layer) != 0 && _times_remaining > 0) {
|
if ((_blinking_layer_mask & (rgblight_layer_mask_t)1 << layer) != 0) {
|
||||||
if (_times_remaining % 2 == 1) {
|
if (_times_remaining % 2 == 1) {
|
||||||
rgblight_set_layer_state(layer, false);
|
rgblight_set_layer_state(layer, false);
|
||||||
} else {
|
} else {
|
||||||
rgblight_set_layer_state(layer, true);
|
rgblight_set_layer_state(layer, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
_times_remaining--;
|
_times_remaining--;
|
||||||
_repeat_timer = sync_timer_read() + _dur;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (_times_remaining <= 0) {
|
if (_times_remaining <= 0) {
|
||||||
_blinking_layer_mask = 0;
|
_blinking_layer_mask = 0;
|
||||||
|
} else {
|
||||||
|
_repeat_timer = sync_timer_read() + _dur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue