fl16: Don't turn off LEDs in USB suspend

Signed-off-by: Daniel Schaefer <dhs@frame.work>
This commit is contained in:
Daniel Schaefer 2023-11-17 17:14:41 +08:00
parent 385ed1a291
commit 1e6896999f
3 changed files with 13 additions and 1 deletions

View File

@ -59,6 +59,10 @@
// RGB config
// Don't turn off backlight and caps LED when in USB suspend
// Because with selective suspend, the driver will eagerly suspend the keyboard after only a short while of inactivity
#define NO_SUSPEND_POWER_DOWN
// Must keep this, so we can suspend RGB backlight with SLEEP# pin
#define RGB_DISABLE_WHEN_USB_SUSPENDED
// RGB Matrix Animation modes. Explicitly enabled

View File

@ -43,7 +43,9 @@ void suspend_power_down_kb(void) {
suspend_power_down_user();
#ifdef RGB_MATRIX_ENABLE
# ifndef NO_SUSPEND_POWER_DOWN
writePinLow(IS31FL3743A_ENABLE_GPIO);
# endif
#endif
}
@ -54,8 +56,9 @@ void suspend_wakeup_init_kb(void) {
suspend_wakeup_init_user();
#ifdef RGB_MATRIX_ENABLE
setPinOutput(IS31FL3743A_ENABLE_GPIO);
# ifndef NO_SUSPEND_POWER_DOWN
writePinHigh(IS31FL3743A_ENABLE_GPIO);
# endif
#endif
}

View File

@ -267,6 +267,11 @@ bool handle_idle(void) {
}
#ifdef RGB_MATRIX_ENABLE
if (rgb_matrix_get_suspend_state() != asleep) {
if asleep {
writePinLow(IS31FL3743A_ENABLE_GPIO)
} else {
writePinHigh(IS31FL3743A_ENABLE_GPIO)
}
rgb_matrix_set_suspend_state(asleep);
}
#endif