X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Favr%2Fsuspend.c;h=2259201b5d99cf37c6b9bf7630c731b3606cd40c;hb=94c4b6bd740bf1dbc2ff45a4a5f6385d06440ef0;hp=28219f4ddd7b900d356e15c7062b070141639919;hpb=7aba1fd1767ecd7df25323c51332c7af986a3805;p=qmk_firmware.git diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 28219f4dd..2259201b5 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -11,9 +11,6 @@ #include "led.h" #include "host.h" #include "rgblight_reconfig.h" -#ifdef SPLIT_KEYBOARD - #include "split_flags.h" -#endif #ifdef PROTOCOL_LUFA #include "lufa.h" @@ -102,24 +99,31 @@ static uint8_t wdt_timeout = 0; */ static void power_down(uint8_t wdto) { #ifdef PROTOCOL_LUFA - if (USB_DeviceState == DEVICE_STATE_Configured) return; + if (USB_DeviceState == DEVICE_STATE_Configured) return; #endif - wdt_timeout = wdto; + wdt_timeout = wdto; - // Watchdog Interrupt Mode - wdt_intr_enable(wdto); + // Watchdog Interrupt Mode + wdt_intr_enable(wdto); #ifdef BACKLIGHT_ENABLE - backlight_set(0); + backlight_set(0); #endif - // Turn off LED indicators - led_set(0); + // Turn off LED indicators + uint8_t leds_off = 0; +#if defined(BACKLIGHT_CAPS_LOCK) && defined(BACKLIGHT_ENABLE) + if (is_backlight_enabled()) { + // Don't try to turn off Caps Lock indicator as it is backlight and backlight is already off + leds_off |= (1<