Skip to content

Commit

Permalink
rgblight: Fix rgblight_blink_layer when multiple layers are active (q…
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis authored and zykrah committed Jul 2, 2022
1 parent f87ef5d commit a7bd725
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions quantum/rgblight/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,18 +844,19 @@ void rgblight_unblink_all_but_layer(uint8_t layer) {
void rgblight_blink_layer_repeat_helper(void) {
if (_blinking_layer_mask != 0 && timer_expired(sync_timer_read(), _repeat_timer)) {
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) {
rgblight_set_layer_state(layer, false);
} else {
rgblight_set_layer_state(layer, true);
}
_times_remaining--;
_repeat_timer = sync_timer_read() + _dur;
}
}
_times_remaining--;
if (_times_remaining <= 0) {
_blinking_layer_mask = 0;
} else {
_repeat_timer = sync_timer_read() + _dur;
}
}
}
Expand Down

0 comments on commit a7bd725

Please sign in to comment.