fix(underglow): Fix racing that led strip get updated again after off
The timer was not being stopped before updating all LEDs to `#000000`. In boards without a EXT_POWER, this will cause the LEDs being turned on immediately after they get turned off. Signed-off-by: XiNGRZ <hi@xingrz.me>
This commit is contained in:
parent
408b87ae7b
commit
1c862c5b94
1 changed files with 3 additions and 3 deletions
|
@ -332,15 +332,15 @@ int zmk_rgb_underglow_off() {
|
|||
}
|
||||
#endif
|
||||
|
||||
k_timer_stop(&underglow_tick);
|
||||
state.on = false;
|
||||
|
||||
for (int i = 0; i < STRIP_NUM_PIXELS; i++) {
|
||||
pixels[i] = (struct led_rgb){r : 0, g : 0, b : 0};
|
||||
}
|
||||
|
||||
led_strip_update_rgb(led_strip, pixels, STRIP_NUM_PIXELS);
|
||||
|
||||
k_timer_stop(&underglow_tick);
|
||||
state.on = false;
|
||||
|
||||
return zmk_rgb_underglow_save_state();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue