From b2badef7d0af58b5b991ed480b5a4e2fe84b0bce Mon Sep 17 00:00:00 2001 From: Peter Eichinger Date: Fri, 22 Jan 2016 17:37:22 +0100 Subject: [PATCH 1/2] Backlight fix from reddit https://www.reddit.com/r/olkb/comments/41ur41/crazy_flashing_when_my_computer_sleeps/ --- tmk_core/common/avr/suspend.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index af99f52b5e..22c402b025 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -8,6 +8,7 @@ #include "suspend_avr.h" #include "suspend.h" #include "timer.h" +#include "led.h" #ifdef PROTOCOL_LUFA #include "lufa.h" #endif @@ -64,6 +65,12 @@ static void power_down(uint8_t wdto) // Watchdog Interrupt Mode wdt_intr_enable(wdto); +#ifdef BACKLIGHT_ENABLE +backlight_set(0); +#endif + + led_off(); + // TODO: more power saving // See PicoPower application note // - I/O port input with pullup @@ -89,6 +96,9 @@ __attribute__ ((weak)) void matrix_power_up(void) {} __attribute__ ((weak)) void matrix_power_down(void) {} bool suspend_wakeup_condition(void) { +#ifdef BACKLIGHT_ENABLE + backlight_set(0); +#endif matrix_power_up(); matrix_scan(); matrix_power_down(); @@ -104,8 +114,10 @@ void suspend_wakeup_init(void) // clear keyboard state clear_keyboard(); #ifdef BACKLIGHT_ENABLE + backlight_set(0); backlight_init(); #endif +led_set(host_keyboard_leds()); } #ifndef NO_SUSPEND_POWER_DOWN @@ -122,3 +134,4 @@ ISR(WDT_vect) } } #endif + From c5f90eb99b282c7425e151b82f0ca22969a4a275 Mon Sep 17 00:00:00 2001 From: Peter Eichinger Date: Sun, 24 Jan 2016 11:13:11 +0100 Subject: [PATCH 2/2] Remove led_off() it is not used --- tmk_core/common/avr/suspend.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 22c402b025..caf0b06254 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -69,8 +69,6 @@ static void power_down(uint8_t wdto) backlight_set(0); #endif - led_off(); - // TODO: more power saving // See PicoPower application note // - I/O port input with pullup