diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-01-25 11:56:00 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-01-25 11:56:00 -0500 |
commit | 3ea6927b7086b2d2e81ed5e581fd44918d14692e (patch) | |
tree | c20d43cfa5cc4980f8dcf967832e8c913bb84bbe /tmk_core/common | |
parent | e9356dcad5769bc917ab9d3366013b5f193c3ef3 (diff) | |
parent | 78192791bc0bb98d7a469f88a77febb3250c5b93 (diff) |
Merge pull request #109 from petereichinger/master
Fix flickering when sleeping
Diffstat (limited to 'tmk_core/common')
-rw-r--r-- | tmk_core/common/avr/suspend.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index af99f52b5e..caf0b06254 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,10 @@ static void power_down(uint8_t wdto) // Watchdog Interrupt Mode wdt_intr_enable(wdto); +#ifdef BACKLIGHT_ENABLE +backlight_set(0); +#endif + // TODO: more power saving // See PicoPower application note // - I/O port input with pullup @@ -89,6 +94,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 +112,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 +132,4 @@ ISR(WDT_vect) } } #endif + |