diff options
| -rw-r--r-- | tmk_core/common/chibios/suspend.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 8c071e7a0..64dfc05ab 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "mousekey.h" | 9 | #include "mousekey.h" |
| 10 | #include "host.h" | 10 | #include "host.h" |
| 11 | #include "suspend.h" | 11 | #include "suspend.h" |
| 12 | #include "led.h" | ||
| 12 | #include "wait.h" | 13 | #include "wait.h" |
| 13 | 14 | ||
| 14 | #ifdef BACKLIGHT_ENABLE | 15 | #ifdef BACKLIGHT_ENABLE |
| @@ -47,6 +48,20 @@ __attribute__((weak)) void suspend_power_down_kb(void) { suspend_power_down_user | |||
| 47 | * FIXME: needs doc | 48 | * FIXME: needs doc |
| 48 | */ | 49 | */ |
| 49 | void suspend_power_down(void) { | 50 | void suspend_power_down(void) { |
| 51 | #ifdef BACKLIGHT_ENABLE | ||
| 52 | backlight_set(0); | ||
| 53 | #endif | ||
| 54 | |||
| 55 | // Turn off LED indicators | ||
| 56 | uint8_t leds_off = 0; | ||
| 57 | #if defined(BACKLIGHT_CAPS_LOCK) && defined(BACKLIGHT_ENABLE) | ||
| 58 | if (is_backlight_enabled()) { | ||
| 59 | // Don't try to turn off Caps Lock indicator as it is backlight and backlight is already off | ||
| 60 | leds_off |= (1 << USB_LED_CAPS_LOCK); | ||
| 61 | } | ||
| 62 | #endif | ||
| 63 | led_set(leds_off); | ||
| 64 | |||
| 50 | // TODO: figure out what to power down and how | 65 | // TODO: figure out what to power down and how |
| 51 | // shouldn't power down TPM/FTM if we want a breathing LED | 66 | // shouldn't power down TPM/FTM if we want a breathing LED |
| 52 | // also shouldn't power down USB | 67 | // also shouldn't power down USB |
| @@ -119,6 +134,7 @@ void suspend_wakeup_init(void) { | |||
| 119 | #ifdef BACKLIGHT_ENABLE | 134 | #ifdef BACKLIGHT_ENABLE |
| 120 | backlight_init(); | 135 | backlight_init(); |
| 121 | #endif /* BACKLIGHT_ENABLE */ | 136 | #endif /* BACKLIGHT_ENABLE */ |
| 137 | led_set(host_keyboard_leds()); | ||
| 122 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) | 138 | #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) |
| 123 | is_suspended = false; | 139 | is_suspended = false; |
| 124 | if (rgblight_enabled) { | 140 | if (rgblight_enabled) { |
